type property Null safety

Type type

Implementation

Type get type {
  // Removes the generic type from UserExceptionAction, WaitAction,
  // NavigateAction and PersistAction.
  // For example UserExceptionAction<AppState> becomes UserExceptionAction<dynamic>.
  if (action is UserExceptionAction) {
    if (action.runtimeType.toString().split('<')[0] == 'UserExceptionAction') //
      return UserExceptionAction;
  } else if (action is WaitAction) {
    if (action.runtimeType.toString().split('<')[0] == 'WaitAction') //
      return WaitAction;
  } else if (action is NavigateAction) {
    if (action.runtimeType.toString().split('<')[0] == 'NavigateAction') //
      return NavigateAction;
  } else if (action is PersistAction) {
    if (action.runtimeType.toString().split('<')[0] == 'PersistAction') //
      return PersistAction;
  }

  return action.runtimeType;
}