如何在颤振中使用带路由的firebase初始化
我需要在颤振路由环境中初始化Fiberbese应用程序 我想用如何在颤振中使用带路由的firebase初始化,firebase,flutter,Firebase,Flutter,我需要在颤振路由环境中初始化Fiberbese应用程序 我想用 final Future\u initialization=Firebase.initializeApp() 在未来完成后,我需要直达初始路线 initialRoute:<**Replace this with a string after future returns**>, routes: { MyHomePage.Id :(context) => MyHomePage(),
final Future\u initialization=Firebase.initializeApp()代码>
在未来完成后,我需要直达初始路线
initialRoute:<**Replace this with a string after future returns**>,
routes: {
MyHomePage.Id :(context) => MyHomePage(),
SoundTester.Id :(context) => SoundTester(),
GoogleMapSample.Id:(context) => GoogleMapSample()
},
initialRoute:,
路线:{
MyHomePage.Id:(上下文)=>MyHomePage(),
SoundTester.Id:(上下文)=>SoundTester(),
Id:(上下文)=>GoogleMapSample()
},
有没有办法做到这一点?或者这是不可能做到的?使用main()方法在main.dart中初始化应用程序,如下所示
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); // add this line
await Firebase.initializeApp(); // add this line
runApp(MyApp());
}
Future main()异步{
WidgetsFlutterBinding.ensureInitialized();//添加此行
等待Firebase.initializeApp();//添加此行
runApp(MyApp());
}
在main