copyWith method
AFRouteState
copyWith({
- AFRouteStateSegments? screenSegs,
- AFRouteStateSegments? popupSegs,
- Map<
AFID, AFRouteSegment> ? globalPool, - AFTimeState? timeLastUpdate,
- Map<
AFUIType, AFRouteStateShowScreen> ? showScreen,
Implementation
AFRouteState copyWith({
AFRouteStateSegments? screenSegs,
AFRouteStateSegments? popupSegs,
Map<AFID, AFRouteSegment>? globalPool,
AFTimeState? timeLastUpdate,
Map<AFUIType, AFRouteStateShowScreen>? showScreen,
}) {
var gp = globalPool ?? this.globalPool;
if(!gp.containsKey(AFUIScreenID.unused)) {
gp = Map<AFID, AFRouteSegment>.from(gp);
gp[AFUIScreenID.unused] = const AFRouteSegment(param: AFRouteParamUnused.unused, children: null, createDefaultChildParam: null);
}
final revised = AFRouteState(
screenHierarchy: screenSegs ?? this.screenHierarchy,
globalPool: gp,
timeLastUpdate: timeLastUpdate ?? this.timeLastUpdate,
showingScreens: showScreen ?? this.showingScreens,
);
if(screenSegs != null) {
AFibD.logRouteAF?.d("Revised Route $revised");
}
return revised;
}