Offline Support
This commit is contained in:
@@ -1,33 +1 @@
|
||||
import '../utils/app_time.dart';
|
||||
|
||||
class ChatMessage {
|
||||
ChatMessage({
|
||||
required this.id,
|
||||
required this.threadId,
|
||||
required this.senderId,
|
||||
required this.body,
|
||||
required this.createdAt,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final String threadId;
|
||||
final String senderId;
|
||||
final String body;
|
||||
final DateTime createdAt;
|
||||
|
||||
factory ChatMessage.fromMap(Map<String, dynamic> map) {
|
||||
return ChatMessage(
|
||||
id: map['id'] as String,
|
||||
threadId: map['thread_id'] as String,
|
||||
senderId: map['sender_id'] as String,
|
||||
body: map['body'] as String,
|
||||
createdAt: AppTime.parse(map['created_at'] as String),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'thread_id': threadId,
|
||||
'sender_id': senderId,
|
||||
'body': body,
|
||||
};
|
||||
}
|
||||
export 'chat_message.model.dart';
|
||||
|
||||
Reference in New Issue
Block a user