I want to clear all previous routes in Getx. That's why I am using that function:
static Future<void> removeAllAndNavigate(
String nextScreen, {
bool Function(Route<dynamic>)? predicate,
dynamic arguments,
int? id,
Map<String, String>? parameters, }) async {
Get.offAllNamed(
nextScreen,
predicate: predicate,
arguments: arguments,
id: id,
parameters: parameters,
); }
But today I realised that, it remember the previous route name. Cause after navigating new screen, I called
print(Get.previousRoute);
and it show me previous route name. Where is the problem ?