handleLifecycleMessage method Null safety

dynamic handleLifecycleMessage(
  1. Map arguments
)

Implementation

static handleLifecycleMessage(Map arguments) {
  Map? pageParams = arguments['page'];
  Map? appParams = arguments['application'];
  if (pageParams != null) {
    String? appearRoute = pageParams['appearRoute'];
    String? disappearRoute = pageParams['disappearRoute'];
    String? appearPageType = pageParams['appearPageType'];
    String? disappearPageType = pageParams['disappearPageType'];
    String? actionType = pageParams['actionType'];
    PageModel model = PageModel(
        currentPageRoute: appearRoute,
        prePageRoute: disappearRoute,
        currentPageType: appearPageType,
        prePageType: disappearPageType,
        actionType: actionType);
    DStack.instance.dLifeCycleObserver?.pageAppear(model);
  }
  if (appParams != null) {
    String? currentRoute = appParams['currentRoute'];
    String? pageType = appParams['pageType'];
    DLifeCycleState state = DLifeCycleState.values[appParams['state']];
    PageModel model =
        PageModel(currentPageRoute: currentRoute, currentPageType: pageType);
    switch (state) {
      case DLifeCycleState.create:
        DStack.instance.dLifeCycleObserver?.appDidStart(model);
        break;
      case DLifeCycleState.foreground:
        DStack.instance.dLifeCycleObserver?.appDidEnterForeground(model);
        break;
      case DLifeCycleState.background:
        DStack.instance.dLifeCycleObserver?.appDidEnterBackground(model);
        break;
    }
  }
}