first commit
This commit is contained in:
40
lib/common/events/common_events.dart
Normal file
40
lib/common/events/common_events.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user