오대리ㅣㅣㅣㅣ
This commit is contained in:
25
mobile/lib/models/room_model.dart
Normal file
25
mobile/lib/models/room_model.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
class RoomModel {
|
||||
RoomModel({
|
||||
required this.id,
|
||||
required this.isGroup,
|
||||
this.name,
|
||||
this.lastBody,
|
||||
this.lastAt,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final bool isGroup;
|
||||
final String? name;
|
||||
final String? lastBody;
|
||||
final String? lastAt;
|
||||
|
||||
factory RoomModel.fromJson(Map<String, dynamic> j) {
|
||||
return RoomModel(
|
||||
id: j['id'] as String,
|
||||
isGroup: (j['is_group'] as int? ?? 0) == 1,
|
||||
name: j['name'] as String?,
|
||||
lastBody: j['last_body'] as String?,
|
||||
lastAt: j['last_at'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user