uri_typed_template 0.7.1 uri_typed_template: ^0.7.1 copied to clipboard
Build and parse URIs with simple declarations based on Dart extensions.
Build and parse URIs with simple declarations based on Dart extensions.
Install #
# pubspec.yaml
dependencies:
uri_template:
Quickstart #
final template =
'album' / 'id'(int) / 'photos' & 'theme'<String>('dark');
final uri = template.build(
{
'id': 7,
'theme': 'light',
},
); // "album/7/photos?theme=light"
final match = template.match('album/7/photos?theme=light');
if(match.isSuccess) {
int id = match['id']; // 7
String theme = match['theme']; // "light"
}
Roadmap #
- Template equality & comparer