init method

  1. @override
Map<ModularKey, ModularRoute> init()
inherited

Used to return a route map at the start of the application.

Implementation

@override
Map<ModularKey, ModularRoute> init() {
  modules.clear();
  modules.add(this);
  final _routeMap = <ModularKey, ModularRoute>{};
  for (var route in routes) {
    _routeMap.addAll(assembleRoute(route));
  }

  final _odernatedMap = <ModularKey, ModularRoute>{};
  for (var key in orderRouteKeys(_routeMap.keys)) {
    _odernatedMap[key] = _routeMap[key]!;
  }
  return _odernatedMap;
}