|
|
|
@ -131,8 +131,7 @@ final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
|
|
|
|
|
|
|
|
|
|
EventBus eventBus = EventBus(sync: true); |
|
|
|
|
|
|
|
|
|
Route lastRoutePage;//记录最后一次启动的页面 |
|
|
|
|
|
|
|
|
|
Route lastRoutePage; |
|
|
|
|
class MyApp extends StatelessWidget { |
|
|
|
|
final Locale appLocale; |
|
|
|
|
final bool isFirst; |
|
|
|
@ -188,10 +187,10 @@ class MyApp extends StatelessWidget {
|
|
|
|
|
), |
|
|
|
|
onGenerateRoute: (settings) { |
|
|
|
|
final String name = settings.name; |
|
|
|
|
if(lastRoutePage?.settings?.name == name){//这次启动的页面是否和上一次启动的页面相同 |
|
|
|
|
if(lastRoutePage?.settings?.name == "/router/personal_page"//这次启动的是不是个人页面 |
|
|
|
|
&& lastRoutePage.navigator != null)//上一次启动的页面是否已经退出 |
|
|
|
|
lastRoutePage.navigator.pop();//如果上一次启动的页面还没退出就主动退出上一次的页面,并接着启动这次要启动的页面 |
|
|
|
|
if(lastRoutePage?.settings?.name == name){ |
|
|
|
|
if(lastRoutePage?.settings?.name == "/router/personal_page" |
|
|
|
|
&& lastRoutePage.navigator != null) |
|
|
|
|
lastRoutePage.navigator.pop(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
final Function pageContentBuilder = routers[name]; |
|
|
|
|