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 {
5454 userId = map['userId' ];
5555 // name = map['name'];
5656 // profilePic = map['profilePic'];
57- likeCount = map['likeCount' ];
57+ likeCount = map['likeCount' ] ?? 0 ;
5858 commentCount = map['commentCount' ];
5959 retweetCount = map["retweetCount" ] ?? 0 ;
6060 imagePath = map['imagePath' ];
@@ -72,12 +72,17 @@ class FeedModel {
7272 }
7373 if (map["likeList" ] != null ) {
7474 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 = [];
8186 }
8287 } else {
8388 likeList = [];
Original file line number Diff line number Diff line change @@ -567,7 +567,7 @@ class _UserList extends StatelessWidget {
567567 onUserSelected: (user) {
568568 textEditingController.text =
569569 Provider .of <ComposeTweetState >(context)
570- .getDescription (user.userName);
570+ .getDescription (user.userName) + " " ;
571571 textEditingController.selection = TextSelection .collapsed (
572572 offset: textEditingController.text.length);
573573 Provider .of <ComposeTweetState >(context).onUserSelected ();
Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ class _ChatListPageState extends State<ChatListPage> {
4646 ),
4747 );
4848 } else {
49+ if (searchState.userList.isEmpty){
50+ searchState.resetFilterList ();
51+ }
4952 return ListView .separated (
5053 physics: BouncingScrollPhysics (),
5154 itemCount: state.chatUserList.length,
@@ -100,7 +103,7 @@ class _ChatListPageState extends State<ChatListPage> {
100103 ),
101104 ),
102105 title: TitleText (
103- model.displayName,
106+ model.displayName ?? "NA" ,
104107 fontSize: 16 ,
105108 fontWeight: FontWeight .w800,
106109 overflow: TextOverflow .ellipsis,
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ class TweetIconsRow extends StatelessWidget {
143143 }
144144
145145 Widget _likeCommentWidget (BuildContext context) {
146- bool isLikeAvailable = model.likeCount > 0 ;
146+ bool isLikeAvailable = model.likeCount != null ? model.likeCount > 0 : false ;
147147 bool isRetweetAvailable = model.retweetCount > 0 ;
148148 bool isLikeRetweetAvailable = isRetweetAvailable || isLikeAvailable;
149149 return Column (
You can’t perform that action at this time.
0 commit comments