pathPatterns property

List<Pattern> pathPatterns

Represents the "form" of URI paths supported by this BeamLocation.

You can pass in either a String or a RegExp. Beware of using greedy regular expressions as this might lead to unexpected behavior.

For strings, optional path segments are denoted with ':xxx' and consequently {'xxx': <real>} will be put to pathParameters. For regular expressions we use named groups as optional path segments, following regex is tested to be effective in most cases RegExp('/test/(?<test>[a-z]+){0,1}') This will put {'test': <real>} to pathParameters. Note that we use the name from the regex group.

Optional path segments can be used as a mean to pass data regardless of whether there is a browser.

For example: '/books/:id' or using regex RegExp('/test/(?<test>[a-z]+){0,1}')

Implementation

List<Pattern> get pathPatterns;