Skip to content

Commit 3cb7a5e

Browse files
committed
🐛 (fix) Following list from profile removed when updating profile.
Ref -> #143
1 parent 5147042 commit 3cb7a5e

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

lib/model/user.dart

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ class UserModel {
1919
List<String> followersList;
2020
List<String> followingList;
2121

22-
UserModel({
23-
this.email,
24-
this.userId,
25-
this.displayName,
26-
this.profilePic,
27-
this.bannerImage,
28-
this.key,
29-
this.contact,
30-
this.bio,
31-
this.dob,
32-
this.location,
33-
this.createdAt,
34-
this.userName,
35-
this.followers,
36-
this.following,
37-
this.webSite,
38-
this.isVerified,
39-
this.fcmToken,
40-
this.followersList,
41-
});
22+
UserModel(
23+
{this.email,
24+
this.userId,
25+
this.displayName,
26+
this.profilePic,
27+
this.bannerImage,
28+
this.key,
29+
this.contact,
30+
this.bio,
31+
this.dob,
32+
this.location,
33+
this.createdAt,
34+
this.userName,
35+
this.followers,
36+
this.following,
37+
this.webSite,
38+
this.isVerified,
39+
this.fcmToken,
40+
this.followersList,
41+
this.followingList});
4242

4343
UserModel.fromJson(Map<dynamic, dynamic> map) {
4444
if (map == null) {
@@ -65,14 +65,14 @@ class UserModel {
6565
fcmToken = map['fcmToken'];
6666
isVerified = map['isVerified'] ?? false;
6767
if (map['followerList'] != null) {
68-
followersList = List<String>();
68+
followersList = <String>[];
6969
map['followerList'].forEach((value) {
7070
followersList.add(value);
7171
});
7272
}
7373
followers = followersList != null ? followersList.length : null;
7474
if (map['followingList'] != null) {
75-
followingList = List<String>();
75+
followingList = <String>[];
7676
map['followingList'].forEach((value) {
7777
followingList.add(value);
7878
});
@@ -122,6 +122,7 @@ class UserModel {
122122
bool isVerified,
123123
String fcmToken,
124124
List<String> followingList,
125+
List<String> followersList,
125126
}) {
126127
return UserModel(
127128
email: email ?? this.email,
@@ -142,6 +143,7 @@ class UserModel {
142143
webSite: webSite ?? this.webSite,
143144
fcmToken: fcmToken ?? this.fcmToken,
144145
followersList: followersList ?? this.followersList,
146+
followingList: followingList ?? this.followingList,
145147
);
146148
}
147149

0 commit comments

Comments
 (0)