isCurrentRoute method

  1. @override
bool isCurrentRoute(
  1. BuildContext context,
  2. String path
)
override

Checks if the current route matches the given path.

Implementation

@override
bool isCurrentRoute(BuildContext context, String path) {
  final route = ModalRoute.of(context);
  return route?.settings.name == path;
}