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
0
likes
100
pub points
0%
popularity

Build and parse URIs with simple declarations based on Dart extensions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

meta

More

Packages that depend on uri_typed_template