File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ class FeedState extends AppState {
125125 _feedlist.add (model);
126126 }
127127 });
128+ /// Sort Tweet by time
129+ /// It helps to display newest Tweet first.
130+ _feedlist.sort ((x,y) => DateTime .parse (x.createdAt).compareTo (DateTime .parse (y.createdAt)));
128131 }
129132 } else {
130133 _feedlist = null ;
@@ -192,6 +195,9 @@ class FeedState extends AppState {
192195 }
193196 } else {}
194197 if (x == _tweetDetail.replyTweetKeyList.last) {
198+ /// Sort comment by time
199+ /// It helps to display newest Tweet first.
200+ _commentlist.sort ((x,y) => DateTime .parse (y.createdAt).compareTo (DateTime .parse (x.createdAt)));
195201 tweetReplyMap.putIfAbsent (postID, () => _commentlist);
196202 notifyListeners ();
197203 }
You can’t perform that action at this time.
0 commit comments