Open victordsgamorim opened 2 years ago
Did you find anty solution?
@pradeep14598
you can try this
class MyBackButtonDispatcher extends RootBackButtonDispatcher {
@override
Future<bool> didPopRoute() async {
var currentPageName = Get.rootDelegate.currentConfiguration?.currentPage!.name;
if (currentPageName!.startsWith("/user")) {
// cant back
return true;
}
// back
return super.didPopRoute();
}
}
return GetMaterialApp.router(
title: "Application",
initialBinding: BindingsBuilder(
() {
Get.put(HomeService());
Get.put(AuthService());
Get.put(AuthServiceTest());
},
),
getPages: AppPages.routes,
theme: themeData,
backButtonDispatcher: MyBackButtonDispatcher(),
Describe the bug Have been trying GetRouterOutlet to work with the routing, and did simple pages to test it. However, using WillPopScope seems to be affected when tapped. Follow the code below.
/*MATERIAL APP **/
The behaviour expected, according to the code above is to not get back, as you could see it's false. However, is getting back to the previous page.
Flutter Version: Flutter 2.10.4 Engine • revision 57d3bac3dd Tools • Dart 2.16.2 • DevTools 2.9.2
Getx Version: get: ^4.6.5
Describe on which device you found the bug: ex: Android Mobile Phone