Files
Regroup/lib/Main_Screens/ProfileTab/Model/followersModel.dart
2024-07-31 16:08:23 +05:30

89 lines
2.3 KiB
Dart

class FollowersModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
FollowersModel({this.status, this.statusCode, this.message, this.data});
FollowersModel.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? followingIamPrincipalXid;
int? iamPrincipalXid;
Follower? follower;
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.follower});
Data.fromJson(Map<String, dynamic> json) {
followingIamPrincipalXid = json['following_iam_principal_xid'];
iamPrincipalXid = json['iam_principal_xid'];
follower = json['follower'] != null
? new Follower.fromJson(json['follower'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
data['iam_principal_xid'] = this.iamPrincipalXid;
if (this.follower != null) {
data['follower'] = this.follower!.toJson();
}
return data;
}
}
class Follower {
int? id;
String? userName;
String? fullName;
String? profilePhoto;
int? principleTypeXid;
Follower({this.id, this.userName, this.fullName, this.profilePhoto, this.principleTypeXid});
Follower.fromJson(Map<String, dynamic> json) {
id = json['id'];
userName = json['user_name'];
fullName = json['full_name'];
profilePhoto = json['profile_photo'];
principleTypeXid = json['principal_type_xid'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['user_name'] = this.userName;
data['full_name'] = this.fullName;
data['profile_photo'] = this.profilePhoto;
data['principal_type_xid'] = this.principleTypeXid;
return data;
}
}