diff --git a/lib/ui/splash/splash_page.dart b/lib/ui/splash/splash_page.dart index 99cf8e2..e571965 100644 --- a/lib/ui/splash/splash_page.dart +++ b/lib/ui/splash/splash_page.dart @@ -7,6 +7,7 @@ import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/utils/dev_util.dart'; import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:dio/dio.dart'; +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -44,6 +45,8 @@ class _SplashPageState extends State { await Permission.locationWhenInUse.request(); } + final Future _initialization = Firebase.initializeApp(); + Future _initOp() async { await _originOp(); final appProvider = Provider.of(context, listen: false); @@ -65,8 +68,13 @@ class _SplashPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - body: Center( - child: Image.asset(R.ASSETS_PLACEHOLDER_WEBP), + body: FutureBuilder( + future: _initialization, + builder: (context, snapshot) { + return Center( + child: Image.asset(R.ASSETS_PLACEHOLDER_WEBP), + ); + }, ), ); } diff --git a/pubspec.yaml b/pubspec.yaml index 5c8bc92..571de48 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -56,6 +56,7 @@ dependencies: #谷歌崩溃分析 firebase_core: ^1.0.3 firebase_crashlytics: ^2.0.0 + power_logger: ^1.0.1-nullsafety.1 logger: ^1.0.0 aku_ui: