translate static method

AccessEvent? translate(
  1. ActionModel action, {
  2. Map<String, dynamic>? parameters,
})

Implementation

static AccessEvent? translate(ActionModel action,
    {Map<String, dynamic>? parameters}) {
  if (action is GotoPage) {
    return GotoPageEvent(action.app, action.pageID, parameters: parameters);
  } else if (action is OpenDialog) {
  } else if (action is SwitchApp) {
    return SwitchAppWithIDEvent(appId: action.toAppID, goHome: true);
  } else if (action is InternalAction) {
    switch (action.internalActionEnum) {
      case InternalActionEnum.login:
        return LoginEvent(
          app: action.app,
          loginType: LoginType.googleLogin,
        );
      case InternalActionEnum.logout:
        return LogoutEvent(app: action.app);
      case InternalActionEnum.goHome:
        return GoHome(app: action.app);
      default:
        return null;
    }
  }
  return null;
}