searchDelegate method
Implementation
GetDelegate searchDelegate(String? k) {
if (k != null) {
if (!keys.containsKey(k)) {
throw RouteNotFoundException('Route id ($k) not found');
}
return keys[k]!;
}
final currentContext = context;
if (currentContext != null) {
try {
final router = Router.of(currentContext);
if (router.routerDelegate is GetDelegate) {
return router.routerDelegate as GetDelegate;
}
} catch (_) {}
}
return Get.rootController.rootDelegate;
}