mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-05 03:29:30 +01:00
20 lines
579 B
Dart
20 lines
579 B
Dart
|
class Status {
|
||
|
static const String namespace = 'im.fluffychat.statuses';
|
||
|
final String senderId;
|
||
|
final String message;
|
||
|
final DateTime dateTime;
|
||
|
|
||
|
Status(this.senderId, this.message, this.dateTime);
|
||
|
|
||
|
Status.fromJson(Map<String, dynamic> json)
|
||
|
: senderId = json['sender_id'],
|
||
|
message = json['message'],
|
||
|
dateTime = DateTime.fromMillisecondsSinceEpoch(json['date_time']);
|
||
|
|
||
|
Map<String, dynamic> toJson() => <String, dynamic>{
|
||
|
'sender_id': senderId,
|
||
|
'message': message,
|
||
|
'date_time': dateTime.millisecondsSinceEpoch,
|
||
|
};
|
||
|
}
|