LinkMapper class abstract

Class describing mapper of url parameters to route

Example:

class TestMapper extends LinkMapper {
  @override
  UIRoute constructRoute(LinkParams params) {
    return UIRoute<RouteNames>(
      name: RouteNames.posts,
      defaultSettings: const UIRouteSettings(
        global: true,
      ),
      child: Container(),
    );
  }

 @override
 LinkParams mapParamsFromUrl(
   String url,
 ) {
   return const LinkParams(
     pathParams: {
       'testParam': 'qwerty',
     },
     queryParams: {},
     state: null,
   );
 }

  @override
  Future<void> openRoute(UIRoute route) async {
    await app.navigation.routeTo(route as UIRoute<RouteNames>);
  }
}

Constructors

LinkMapper.new()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

constructRoute(LinkParams params) UIRoute
Costructs route with given url params
mapParamsFromUrl(String url) LinkParams
Maps url to params returns record where: first map is path params second map is queryParams third parameter is achor value
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openRoute(UIRoute route) Future<void>
Opens consructed route
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited