mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-09-12 06:47:18 +00:00
23 lines
453 B
Dart
23 lines
453 B
Dart
import 'package:intl/intl.dart';
|
|
|
|
final formater = new DateFormat('hh:mm');
|
|
|
|
class Message {
|
|
Message({this.text, this.type = MessageType.normal}) : time = DateTime.now();
|
|
|
|
final String text;
|
|
final DateTime time;
|
|
final MessageType type;
|
|
String get timeString => formater.format(time);
|
|
|
|
static Message warn({String text}) => Message(
|
|
text: text,
|
|
type: MessageType.warning,
|
|
);
|
|
}
|
|
|
|
enum MessageType {
|
|
normal,
|
|
warning,
|
|
}
|