41 lines
869 B
Dart
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;
|
|
}
|