File tree 4 files changed +8
-7
lines changed
4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ class NotificationModel {
7
7
String ? tweetKey;
8
8
String ? updatedAt;
9
9
String ? createdAt;
10
- late String type;
10
+ late String ? type;
11
11
Map <String , dynamic >? data;
12
12
13
13
NotificationModel ({
@@ -36,5 +36,7 @@ class NotificationModel {
36
36
extension NotificationModelHelper on NotificationModel {
37
37
UserModel get user => UserModel .fromJson (data);
38
38
39
- DateTime ? get timeStamp => DateTime .tryParse (updatedAt ?? createdAt! );
39
+ DateTime ? get timeStamp => updatedAt != null || createdAt != null
40
+ ? DateTime .tryParse (updatedAt ?? createdAt! )
41
+ : null ;
40
42
}
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ class _ComposeTweetReplyPageState extends State<ComposeTweetPage> {
144
144
145
145
/// Checks for username in tweet description
146
146
/// If foud sends notification to all tagged user
147
- /// If no user found or not compost tweet screen is closed and redirect back to home page.
147
+ /// If no user found, compose tweet screen is closed and redirect back to home page.
148
148
await Provider .of <ComposeTweetState >(context, listen: false )
149
149
.sendNotification (
150
150
tweetModel, Provider .of <SearchState >(context, listen: false ))
Original file line number Diff line number Diff line change @@ -71,9 +71,7 @@ class _SuggestedUsersState extends State<SuggestedUsers> {
71
71
await state.followUsers ();
72
72
isLoading.value = false ;
73
73
},
74
- label: state.selectedusersCount < 5
75
- ? '${5 - state .selectedusersCount } more to follow'
76
- : 'Follow ${state .selectedusersCount }' ,
74
+ label: 'Follow ${state .selectedusersCount }' ,
77
75
isWraped: true ,
78
76
borderRadius: 50 ,
79
77
labelStyle: TextStyles .onPrimaryTitleText,
Original file line number Diff line number Diff line change @@ -210,7 +210,8 @@ class _HomePageState extends State<HomePage> {
210
210
final state = context.watch <AuthState >();
211
211
context.read <SuggestionsState >().initUser (state.userModel);
212
212
213
- if (context.watch <SuggestionsState >().displaySuggestions) {
213
+ if (context
214
+ .select <SuggestionsState , bool >((state) => state.displaySuggestions)) {
214
215
return SuggestedUsers ();
215
216
}
216
217
You can’t perform that action at this time.
0 commit comments