selfprivacy.org.app/lib/logic/models/message.dart
NaiJi 2ac8e4366b Linting!
Co-authored-by: Inex Code <inex.code@selfprivacy.org>
2022-06-06 01:40:34 +03:00

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,
}