queryParameters property
Parse the query parameters passed in the route name Example: routeName?id=1&name=foo will result in {'id': '1', 'name':'foo'}
Implementation
Map<String, String> get queryParameters {
if (_queryParameters != null) {
return _queryParameters ?? {};
}
final urlParts = settings.name?.split('?') ?? [];
if (urlParts.length > 1) {
final paramPart = urlParts[1];
final params = <String, String>{};
paramPart.split('&').forEach((p) {
final split = p.split('=');
final key = split[0];
final value = split[1];
params[key] = value;
});
_queryParameters = params;
}
_queryParameters ??= {};
return _queryParameters ?? {};
}