currentRouteName method
The name of the page on screen, from Nylo's router when the app uses it, otherwise from the root navigator.
Implementation
String? currentRouteName() {
if (_nyloRouter) {
try {
final String? name = Nylo.getCurrentRouteName();
if (name != null) return name;
} catch (_) {
// Fall through to the navigator.
}
}
final NavigatorState? navigator = _navigator();
if (navigator == null) return null;
String? name;
navigator.popUntil((Route<dynamic> route) {
name = route.settings.name;
return true;
});
return name;
}