You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
579 B
Dart
20 lines
579 B
Dart
5 years ago
|
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,
|
||
|
};
|
||
|
}
|