Complete refactoring SFM App Source Code
This commit is contained in:
46
lib/feature/inter_family/groups/groups_model.dart
Normal file
46
lib/feature/inter_family/groups/groups_model.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
class Group {
|
||||
String? id;
|
||||
String? type;
|
||||
String? name;
|
||||
String? ownerId;
|
||||
String? status;
|
||||
String? visibility;
|
||||
DateTime? createdAt;
|
||||
DateTime? updatedAt;
|
||||
bool? isOwner;
|
||||
String? description;
|
||||
|
||||
Group({
|
||||
required this.id,
|
||||
this.type,
|
||||
this.name,
|
||||
this.ownerId,
|
||||
this.status,
|
||||
this.visibility,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
this.isOwner,
|
||||
this.description,
|
||||
});
|
||||
|
||||
Group.fromJson(Map<String, dynamic> json) {
|
||||
id = json["id"];
|
||||
type = json["type"];
|
||||
name = json["name"];
|
||||
ownerId = json["owner_id"];
|
||||
status = json["status"];
|
||||
visibility = json["visibility"];
|
||||
createdAt = DateTime.parse(json["created_at"]);
|
||||
updatedAt = DateTime.parse(json["updated_at"]);
|
||||
isOwner = json["is_owner"];
|
||||
description = json["description"];
|
||||
}
|
||||
|
||||
static List<Group> fromJsonList(List list) {
|
||||
return list.map((e) => Group.fromJson(e)).toList();
|
||||
}
|
||||
|
||||
static List<Group> fromJsonDynamicList(List<dynamic> list) {
|
||||
return list.map((e) => Group.fromJson(e)).toList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user