我有一个现有的android应用程序,并且我已经在我的项目中集成了flutter,我想调用我在主要方法中定义的flutter特定路由,如下所示
class FlutterView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Platform View',
initialRoute: '/',
routes: {
'/': (context) => HomeScreen(),
'/secound': (context) => MyCustomForm(),
'/dashboard': (context) => DashBoardScreen(),
'/login': (context) => LoginScreen(),
},
theme: new ThemeData(
primarySwatch: Colors.red,
textSelectionColor: Colors.red,
textSelectionHandleColor: Colors.red,
),
);
}
}
从我的 Android 活动中,我像这样调用颤动活动
startActivity(new Intent(this,FlutterActivity.class));
它确实打开了我的扑动活动,但使用了initialRoute: '/',这很好,但有时我想打开例如('/dashboard')路线,当我打开扑动活动时我该怎么做?