getCurrentRoute method

String getCurrentRoute(
  1. BuildContext context
)

Implementation

String getCurrentRoute(BuildContext context) {
  String current = "/";
  final routeName =
      ModalRoute
          .of(context)
          ?.settings
          .name;
  return routeName ?? current;
}