onMatch method

NopRouteBuilder? onMatch(
  1. RouteSettings settings
)

Implementation

NopRouteBuilder? onMatch(RouteSettings settings) {
  var pathName = settings.name ?? '';
  Map<dynamic, dynamic>? query;
  assert(settings.arguments == null || settings.arguments is Map);
  final uri = Uri.tryParse(pathName);
  if (uri != null) {
    pathName = uri.path;
    if (uri.queryParameters.isNotEmpty) {
      query = Map.of(uri.queryParameters);
    }
  }

  final arguments =
      query ?? settings.arguments as Map<dynamic, dynamic>? ?? const {};

  return _onMatch(this, settings, pathName, arguments);
}