final p = new UriParser(new UriTemplate('/ui'));
final match = p.match(Uri.parse('http://localhost:8080/ui/foo'));
print(match.rest);
Expected
Actual
Cause
UriMatch builds (via UriBuilder) a uri with '' rather than null in fragment and host, plus an empty map for queryParameters.
Uri.toString() assume all those are null or have something interesting in them.
Note: I would consider it a bug in Uri to required null queryParameters as empty collections are normally considered better practice than null