Closed XiongKe94 closed 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, ],
Has solved
How to restart the App? The page is blank after my code restarts?