currentRoute method

  1. @override
String? currentRoute(
  1. BuildContext context
)
override

Returns the current route path as a string, or null if unavailable.

Implementation

@override
String? currentRoute(BuildContext context) {
  return ModalRoute.of(context)?.settings.name;
}