Files
Remever/lib/common/events/common_events.dart
2025-03-03 20:59:42 +03:00

41 lines
869 B
Dart

// Flutter imports:
import 'package:flutter/material.dart';
import 'package:remever/common/resources.dart';
///
/// Событие изменения темы
///
class ThemeChangedEvent {}
enum NotificationEventType { NOTIFY, ERROR, WARNING }
extension NotificationEventTypeExtension on NotificationEventType {
Color get color {
switch (this) {
case NotificationEventType.NOTIFY:
return AppColors.gray;
case NotificationEventType.ERROR:
return AppColors.red;
case NotificationEventType.WARNING:
return AppColors.yellowL;
}
}
}
///
/// Событие оповещения
///
class NotificationEvent {
NotificationEvent({
required this.text,
this.type = NotificationEventType.NOTIFY,
this.action,
});
final String text;
final NotificationEventType type;
final SnackBarAction? action;
}