getAlertInfo function

AlertInfo getAlertInfo(
  1. AlertType type,
  2. BuildContext context
)

Implementation

AlertInfo getAlertInfo(AlertType type, BuildContext context) {
  switch (type) {
    case AlertType.neutral:
      return AlertInfo(
          color: Theme.of(context).colorScheme.outline, iconData: Icons.info);
    case AlertType.success:
      return AlertInfo(
          color: Theme.of(context).colorScheme.tertiary,
          iconData: Icons.check_circle);
    case AlertType.error:
      return AlertInfo(
          color: Theme.of(context).colorScheme.error, iconData: Icons.error);
    case AlertType.warning:
      return AlertInfo(
          color: Theme.of(context).colorScheme.scrim, iconData: Icons.warning);
    case AlertType.info:
      return AlertInfo(
          color: Theme.of(context).colorScheme.primary, iconData: Icons.info);
  }
}