Open mohsinnaqvi0606 opened 1 year ago
I am also facing this issue
@jonataslaw This issue only exist in unNamed routing. I tried Named routing and it's working properly
Define route like this in GetMaterialApp
initialRoute: '/',
getPages: [
GetPage(name: '/', page: () => Splash()),
],
Where you want to restart/navigation write this code
Get.offAllNamed('/');
@jonataslaw This issue only exist in unNamed routing. I tried Named routing and it's working properly
Define route like this in GetMaterialApp
initialRoute: '/', getPages: [ GetPage(name: '/', page: () => Splash()), ],
Where you want to restart/navigation write this code
Get.offAllNamed('/');
Could you please share a full code and also describe the flutter version?
for mean while you can define inside the main.dart
GetMaterialApp(
debugShowCheckedModeBanner: false,
title: "Your App Name",
theme: lightMode,
initialRoute: AppPages.INITIAL,
getPages: AppPages.routes,
themeMode: ThemeMode.system,
darkTheme: darkMode,
),
Getx generates you inside app folder routers folder which will contain two dart file app_pages.dart
and app_routers.dart
those are responsible app routers please check those.
@jonataslaw This issue only exist in unNamed routing. I tried Named routing and it's working properly Define route like this in GetMaterialApp
initialRoute: '/', getPages: [ GetPage(name: '/', page: () => Splash()), ],
Where you want to restart/navigation write this code
Get.offAllNamed('/');
Could you please share a full code and also describe the flutter version?
for mean while you can define inside the main.dart
GetMaterialApp( debugShowCheckedModeBanner: false, title: "Your App Name", theme: lightMode, initialRoute: AppPages.INITIAL, getPages: AppPages.routes, themeMode: ThemeMode.system, darkTheme: darkMode, ),
Getx generates you inside app folder routers folder which will contain two dart file
app_pages.dart
andapp_routers.dart
those are responsible app routers please check those.
I am using it in GetMaterialApp like this
return GetMaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
// home: SplashView(),
initialRoute: '/',
getPages: [
GetPage(name: '/', page: () => SplashView()),
],
)
Flutter & Getx Versions Flutter: 3.13.4 GetX: 4.6.6
I am facing same here
Trying to call Splash Screen from Dashboard(restart App) but Splash controller already exist
Navigating from Splash to Dashboard Screen I am using this code
Get.off(()=> Dashboard());
While Navigating from DashboardSplash to Splash Screen (To perform restart app) I am using this code
Get.offAll(()=> Splash());
GetxController is not disposed here. I am unable to use life cycle of controller as it already exist. I also confirmed it by calling
SplashController controller = Get.find();
Flutter: 3.13.4 GetX: 4.6.6