ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR BUGS DESCRIPTION.Fill in the template. Issues that do not respect the model will be closed.
Describe the bug
I can use redirectDelegate override method but not work and not reflect in Get.toName(Routes, Argument).
any other solution to use async method in use in redirec middelware?
**Reproduction code
@override
Future<GetNavConfig?> redirectDelegate(GetNavConfig route) async {
// Simulate an async operation, such as checking a token or API call
var value = await checkUserAccess();
if (!value)
{
var currentRoute = Get.currentRoute;
Helper.errorMsg("You are not authorized to access this page.", "", null);
return GetNavConfig.fromRoute(currentRoute);
}
else
{
// If not authenticated, redirect to login page
// Get.toNamed(route.location);
return super.redirectDelegate(route);
}
}
ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR BUGS DESCRIPTION. Fill in the template. Issues that do not respect the model will be closed.
Describe the bug I can use redirectDelegate override method but not work and not reflect in Get.toName(Routes, Argument). any other solution to use async method in use in redirec middelware?
**Reproduction code @override Future<GetNavConfig?> redirectDelegate(GetNavConfig route) async { // Simulate an async operation, such as checking a token or API call var value = await checkUserAccess(); if (!value) { var currentRoute = Get.currentRoute; Helper.errorMsg("You are not authorized to access this page.", "", null); return GetNavConfig.fromRoute(currentRoute); } else
{ // If not authenticated, redirect to login page // Get.toNamed(route.location); return super.redirectDelegate(route); } }
Flutter Version: lateest
Getx Version: 4.6.6