How can I know the list of previous pages in flutter, I’m using getx for navigation
I didn’t tried anything.
.
static void checkForRootLink() {
//get currenmt page of the app
log('Current route:${Get.currentRoute}');
log(RuntimeConfigs.routeObserver!.routeStack.toString());
// if (currentRoute == NamedRoutes.socialAppHomeIndex.path) {
// //Already in home screen
// //No need to do anything
// }
// // else if (Get.route) {
// //}
// else {
// CustomRouting.replaceStackWithNamed(NamedRoutes.splashIndex.path);
// // CustomRouting.popUntil(
// // NamedRoutes.root.path,
// // );
// }
}
2
Answers
You can achieve the same by using
https://pub.dev/documentation/navigation_history_observer/latest/#:~:text=To%20access%20the%20history%2C%20use,would%20be%20the%20current%20route.
Here is the solution
Create a route observer file and paste the below code. Add the instance of route observer inside GetmaterailApp.