selfprivacy.org.app/lib/logic/models/message.dart
2022-02-16 10:28:29 +03:00

23 lines
457 B
Dart

import 'package:intl/intl.dart';
final formatter = 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 => formatter.format(time);
static Message warn({String? text}) => Message(
text: text,
type: MessageType.warning,
);
}
enum MessageType {
normal,
warning,
}