jonbhanson / flutter_native_splash

Automatically generates native code for adding splash screens in Android and iOS. Customize with specific platform, background color and splash image.
https://pub.dev/packages/flutter_native_splash
MIT License
1.28k stars 200 forks source link

Background colour of scaffold has changed #151

Closed johnareid54 closed 3 years ago

johnareid54 commented 3 years ago

Windows 10 Flutter 2.0.1

I created a new app and ran the native splash screen code accepting the default and created the default file flutter_native_splash.yaml

The splash screen created ok but on running the app, the background colour is now the same which is used in the splash screen. I have tried changing the theme data but this has no effect.

jonbhanson commented 3 years ago

You mentioned Windows 10 - are you running your app on Windows, or just developing on Windows? Can you add your flutter doctor output?

johnareid54 commented 3 years ago

I develop on Windows and use the web for testing.

flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel beta, 2.0.1, on Microsoft Windows [Version 10.0.19041.867], locale en-GB) [√] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [√] Chrome - develop for the web [√] Android Studio (version 4.0) [√] VS Code (version 1.54.3) [√] VS Code, 64-bit edition (version 1.53.2) [√] Connected device (2 available)

• No issues found!

Printscreen from app with splash screen splash

New app with code pasted in (no splash screen) splash1

jonbhanson commented 3 years ago

Do you have a Scaffold in your app's widget tree?

johnareid54 commented 3 years ago

Yes I use a Scaffold, tried setting the default background in the theme but no luck.

jonbhanson commented 3 years ago

I tried reproducing the problem, but only saw the problem when the Scaffold was missing.

Can you supply me with code so I can reproduce the problem? Either post some skeleton code that reproduces the problem, or send me something?

johnareid54 commented 3 years ago

I stripped the app of all data and put a copy on Google Drive.

I should point out that I run the command flutter pub run flutter_native_splash:create and then delete the link in the pubspec.yaml file as I have had instances of conflicts with other entries (i.e. flutter_automation).

jonbhanson commented 3 years ago

I sent a permission request to access the file... as soon as you approve it, I will take a look. 👍🏻

johnareid54 commented 3 years ago

I tested the plugin on a different computer this morning and it worked fine, so I went back to the original computer and again it worked fine, so it must have been some type of blimp! It just means moving the code into the new file.

Can I just say- this plugin has been a lifesaver - without it the app was getting rejected by the Play store, put in the native screen and it passed. Not sure why the Flutter team could not incorporate your code into the flutter base system.

jonbhanson commented 3 years ago

Glad it worked for you @johnareid54. 👍🏻

jonbhanson commented 3 years ago

@johnareid54 I noticed in your app, your Scaffold has the parameter

backgroundColor: Colors.white54,

Colors.white54 has 54% transparency, so the background color set by the splash screen will show up. If you were looking for an off-white color, you could use Colors.grey[100] or for precise control use Color(0xFFF5F5F5) where the first byte is transparency and should stay FF, and the rest make up the RGB value.