lukepighetti / fluro

Fluro is a Flutter routing library that adds flexible routing options like wildcards, named parameters and clear route definitions.
https://pub.dev/packages/fluro
MIT License
3.67k stars 417 forks source link

reboot app? #285

Closed XiongKe94 closed 6 months ago

XiongKe94 commented 6 months ago

How to restart the App? The page is blank after my code restarts?

    Navigator.of(context).popUntil((route) => false);

    Navigator.push(
      context,
      CupertinoPageRoute(builder: (context) => const MyApp()),
    );
void main() {
  WidgetsFlutterBinding.ensureInitialized();
  Provider.debugCheckInvalidValueType = <GlobalData>(GlobalData value) {
    if (value is Flow) return;
  };
  Routes.initial();
  runApp(
    ChangeNotifierProvider(
      create: (context) => GlobalData(),
      child: const MyApp(),
    ),
  );
}
 MaterialApp(
      navigatorKey: _appNavigatorKey,
      onGenerateRoute: Routes.myRouter.generator,
      builder: FToastBuilder(),
      theme: myTheme.call(),
      debugShowCheckedModeBanner: false,
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
XiongKe94 commented 6 months ago

Has solved