File tree Expand file tree Collapse file tree 4 files changed +18
-10
lines changed Expand file tree Collapse file tree 4 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class FeedModel {
54
54
userId = map['userId' ];
55
55
// name = map['name'];
56
56
// profilePic = map['profilePic'];
57
- likeCount = map['likeCount' ];
57
+ likeCount = map['likeCount' ] ?? 0 ;
58
58
commentCount = map['commentCount' ];
59
59
retweetCount = map["retweetCount" ] ?? 0 ;
60
60
imagePath = map['imagePath' ];
@@ -72,12 +72,17 @@ class FeedModel {
72
72
}
73
73
if (map["likeList" ] != null ) {
74
74
likeList = List <String >();
75
- final list = map['likeList' ];
76
- if (list is List ) {
77
- map['likeList' ].forEach ((value) {
78
- likeList.add (value);
79
- });
80
- likeCount = likeList.length;
75
+ try {
76
+ final list = map['likeList' ];
77
+ if (list is List ) {
78
+ map['likeList' ].forEach ((value) {
79
+ likeList.add (value);
80
+ });
81
+ likeCount = likeList.length ?? 0 ;
82
+ }
83
+ } catch (e) {
84
+ likeCount = 0 ;
85
+ likeList = [];
81
86
}
82
87
} else {
83
88
likeList = [];
Original file line number Diff line number Diff line change @@ -567,7 +567,7 @@ class _UserList extends StatelessWidget {
567
567
onUserSelected: (user) {
568
568
textEditingController.text =
569
569
Provider .of <ComposeTweetState >(context)
570
- .getDescription (user.userName);
570
+ .getDescription (user.userName) + " " ;
571
571
textEditingController.selection = TextSelection .collapsed (
572
572
offset: textEditingController.text.length);
573
573
Provider .of <ComposeTweetState >(context).onUserSelected ();
Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ class _ChatListPageState extends State<ChatListPage> {
46
46
),
47
47
);
48
48
} else {
49
+ if (searchState.userList.isEmpty){
50
+ searchState.resetFilterList ();
51
+ }
49
52
return ListView .separated (
50
53
physics: BouncingScrollPhysics (),
51
54
itemCount: state.chatUserList.length,
@@ -100,7 +103,7 @@ class _ChatListPageState extends State<ChatListPage> {
100
103
),
101
104
),
102
105
title: TitleText (
103
- model.displayName,
106
+ model.displayName ?? "NA" ,
104
107
fontSize: 16 ,
105
108
fontWeight: FontWeight .w800,
106
109
overflow: TextOverflow .ellipsis,
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ class TweetIconsRow extends StatelessWidget {
143
143
}
144
144
145
145
Widget _likeCommentWidget (BuildContext context) {
146
- bool isLikeAvailable = model.likeCount > 0 ;
146
+ bool isLikeAvailable = model.likeCount != null ? model.likeCount > 0 : false ;
147
147
bool isRetweetAvailable = model.retweetCount > 0 ;
148
148
bool isLikeRetweetAvailable = isRetweetAvailable || isLikeAvailable;
149
149
return Column (
You can’t perform that action at this time.
0 commit comments