Files
MessagingApp/lib/models/details.dart
T
onasanya.lanre 1ba9e981e1 Messaging
Implemented Chat Screens, Profile Pages, Search Pages
WIP: User profile, new chat button
Intended: Groups, Calls, Voice Messages
Properly deleting chats, offline storage of messages
2025-03-26 13:41:56 +00:00

31 lines
734 B
Dart

import 'dart:convert';
class Details {
String name;
String image;
int unseenCount;
String? lastMessage;
DateTime? timeStamp;
String? type;
Details({
required this.name,
required this.image,
required this.lastMessage,
required this.timeStamp,
required this.unseenCount,
required this.type
});
factory Details.fromData(String _details) {
return Details(
name: json.decode(_details)['name'],
image: json.decode(_details)['image'],
lastMessage: json.decode(_details)['lastMessage'],
timeStamp: DateTime.parse(json.decode(_details)['timeStamp'] ?? ""),
unseenCount: json.decode(_details)['unseenCount'],
type: json.decode(_details)['type'],
);
}
}