decodePathWhen<T> function
- String path,
- Map<
String, MatchCallback< templateMapT> >
Convenience function for decoding values from a given path that may match
multiple possible templates.
Implementation
T? decodePathWhen<T>(String path, Map<String, MatchCallback<T>> templateMap) {
for (final entry in templateMap.entries) {
final pathMap = tryDecodePathMap(path: path, template: entry.key);
if (pathMap != null) {
return entry.value(pathMap, Uri.parse(path).queryParameters);
}
}
return null;
}