forked from X-Wei/flutter_catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show native splash screen until initialization code is finished
Before we see native splash, then our loading page, then main page.
- Loading branch information
Showing
4 changed files
with
36 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
import 'package:firebase_core/firebase_core.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
import './my_main_app.dart'; | ||
|
||
void main() => runApp(const MyMainApp()); | ||
Future<void> main() async { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
await Firebase.initializeApp(); | ||
final sharedPref = await SharedPreferences.getInstance(); | ||
runApp(MyMainApp(sharedPref)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
import 'package:firebase_core/firebase_core.dart'; | ||
import 'package:flutter/foundation.dart' | ||
show debugDefaultTargetPlatformOverride; | ||
import 'package:flutter/material.dart'; | ||
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
import './my_main_app.dart'; | ||
|
||
void main() { | ||
Future<void> main() async { | ||
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia; | ||
runApp(const MyMainApp()); | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
await Firebase.initializeApp(); | ||
final sharedPref = await SharedPreferences.getInstance(); | ||
runApp(MyMainApp(sharedPref)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters