AFRouteState.initialState constructor

AFRouteState.initialState()

Creates the default initial state.

Implementation

factory AFRouteState.initialState() {
  final screen = <AFRouteSegment>[];
  final routeParamFactory = AFibF.g.startupRouteParamFactory;
  if(routeParamFactory == null) throw AFException("Missing startup route");
  screen.add(AFRouteSegment.withParam(routeParamFactory(), null, null));
  final screenSegs = AFRouteStateSegments(active: screen, prior: emptySegments);
  final globalPool = <AFScreenID, AFRouteSegment>{};
  globalPool[AFUIScreenID.unused] = const AFRouteSegment(param: AFRouteParamUnused.unused, children: null, createDefaultChildParam: null);
  return AFRouteState(screenHierarchy: screenSegs, globalPool: globalPool, timeLastUpdate: AFTimeState.createNow(), showingScreens: const <AFUIType, AFRouteStateShowScreen>{});
}