You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can keep native splash screen as long as you want by the following code:
Future<void> main() async {
final binding =WidgetsFlutterBinding.ensureInitialized();
// Prevents app from closing splash screen, app layout will be build but not displayed.
binding.deferFirstFrame();
binding.addPostFrameCallback((_) async {
BuildContext? context = binding.renderViewElement;
if (context !=null) {
// Run any sync or awaited async function you want to wait for before showing app layoutawaitInit.instance.initialize(context);
}
// Closes splash screen, and show the app layout.
binding.allowFirstFrame();
});
runApp(...);
}
classInit {
Init._();
staticfinal instance =Init._();
Futureinitialize(BuildContext context) async {
// This is where you can initialize the resources needed by your app while// the splash screen is displayed. Remove the following example because// delaying the user experience is a bad design practice!awaitFuture.delayed(constDuration(seconds:3));
}
}
The text was updated successfully, but these errors were encountered:
Thanks to this comment by @0x48Maciek
You can keep native splash screen as long as you want by the following code:
The text was updated successfully, but these errors were encountered: