Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White screen on web when using "FlutterNativeSplash.remove()" #607

Closed
eggp opened this issue Oct 23, 2023 · 1 comment
Closed

White screen on web when using "FlutterNativeSplash.remove()" #607

eggp opened this issue Oct 23, 2023 · 1 comment

Comments

@eggp
Copy link

eggp commented Oct 23, 2023

Hello,

On the web, when I want to use "FlutterNativeSplash.remove()", a white screen appears for a moment after the splash screen is removed. Example code: https://github.com/eggp/flutter_native_splash_web_flickering_fix/blob/main/lib/main.dart | demo app: https://eggp.github.io/flutter_native_splash_web_flickering_fix/flickering/

I think the solution is simple. Because of the JavaScript eventloop, you have to use the setTimeout(0) trick, which I usually achieve using SchedulerBinding in flutter. Example code: https://github.com/eggp/flutter_native_splash_web_flickering_fix/blob/fix/lib/main.dart#L13 | demo app: https://eggp.github.io/flutter_native_splash_web_flickering_fix/fix/

The problem arises from the fact that Timer is in the widgetsBinding.allowFirstFrame->scheduleWarmUpFrame call chain.

@jonbhanson
Copy link
Owner

@eggp This is excellent, thanks! I will push an update soon that adds this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants