mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-08 18:03:12 +00:00
21 lines
444 B
Dart
21 lines
444 B
Dart
import 'package:intl/intl.dart';
|
|
|
|
final DateFormat formatter = DateFormat('hh:mm');
|
|
|
|
class Message {
|
|
Message({this.text, this.type = MessageType.normal}) : time = DateTime.now();
|
|
Message.warn({this.text})
|
|
: type = MessageType.warning,
|
|
time = DateTime.now();
|
|
|
|
final String? text;
|
|
final DateTime time;
|
|
final MessageType type;
|
|
String get timeString => formatter.format(time);
|
|
}
|
|
|
|
enum MessageType {
|
|
normal,
|
|
warning,
|
|
}
|