84 lines
2.2 KiB
Dart
84 lines
2.2 KiB
Dart
class CommunityListModel {
|
|
String? status;
|
|
int? statusCode;
|
|
String? message;
|
|
List<Data>? data;
|
|
|
|
CommunityListModel({this.status, this.statusCode, this.message, this.data});
|
|
|
|
CommunityListModel.fromJson(Map<String, dynamic> json) {
|
|
status = json['status'];
|
|
statusCode = json['status_code'];
|
|
message = json['message'];
|
|
if (json['data'] != null) {
|
|
data = <Data>[];
|
|
json['data'].forEach((v) {
|
|
data!.add(new Data.fromJson(v));
|
|
});
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['status'] = this.status;
|
|
data['status_code'] = this.statusCode;
|
|
data['message'] = this.message;
|
|
if (this.data != null) {
|
|
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Data {
|
|
int? id;
|
|
int? iamPrincipalXid;
|
|
int? manageCommunityXid;
|
|
Community? community;
|
|
|
|
Data(
|
|
{this.id, this.iamPrincipalXid, this.manageCommunityXid, this.community});
|
|
|
|
Data.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
iamPrincipalXid = json['iam_principal_xid'];
|
|
manageCommunityXid = json['manage_community_xid'];
|
|
community = json['community'] != null
|
|
? new Community.fromJson(json['community'])
|
|
: null;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['id'] = this.id;
|
|
data['iam_principal_xid'] = this.iamPrincipalXid;
|
|
data['manage_community_xid'] = this.manageCommunityXid;
|
|
if (this.community != null) {
|
|
data['community'] = this.community!.toJson();
|
|
}
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Community {
|
|
int? id;
|
|
String? communityName;
|
|
String? communityProfilePhoto;
|
|
|
|
Community({this.id, this.communityName, this.communityProfilePhoto});
|
|
|
|
Community.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
communityName = json['community_name'];
|
|
communityProfilePhoto = json['community_profile_photo'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['id'] = this.id;
|
|
data['community_name'] = this.communityName;
|
|
data['community_profile_photo'] = this.communityProfilePhoto;
|
|
return data;
|
|
}
|
|
}
|