localizeNotificationType function

String localizeNotificationType(
  1. AppNotificationType type
)

Convert the notification type into a displayable text for the UI

Implementation

String localizeNotificationType(AppNotificationType type) {
  switch (type) {
    case AppNotificationType.shutdown:
      return 'Shutdown';
    case AppNotificationType.warning:
    case AppNotificationType.maintenanceNotice:
      return 'Warning';
    case AppNotificationType.longRunningNotice:
    case AppNotificationType.notice:
    case AppNotificationType.engineStartedNotice:
    case AppNotificationType.engineStoppedNotice:
    case AppNotificationType.exerciseEndedNotice:
    case AppNotificationType.exerciseStartedNotice:
    case AppNotificationType.offlineNotice:
    case AppNotificationType.onlineNotice:
      return 'Notice';
  }
}