Skip to content

Commit 607d03c

Browse files
committed
🩹 Small fixes
1 parent 833ed24 commit 607d03c

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

lib/model/notificationModel.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class NotificationModel {
77
String? tweetKey;
88
String? updatedAt;
99
String? createdAt;
10-
late String type;
10+
late String? type;
1111
Map<String, dynamic>? data;
1212

1313
NotificationModel({
@@ -36,5 +36,7 @@ class NotificationModel {
3636
extension NotificationModelHelper on NotificationModel {
3737
UserModel get user => UserModel.fromJson(data);
3838

39-
DateTime? get timeStamp => DateTime.tryParse(updatedAt ?? createdAt!);
39+
DateTime? get timeStamp => updatedAt != null || createdAt != null
40+
? DateTime.tryParse(updatedAt ?? createdAt!)
41+
: null;
4042
}

lib/ui/page/feed/composeTweet/composeTweet.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class _ComposeTweetReplyPageState extends State<ComposeTweetPage> {
144144

145145
/// Checks for username in tweet description
146146
/// 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.
148148
await Provider.of<ComposeTweetState>(context, listen: false)
149149
.sendNotification(
150150
tweetModel, Provider.of<SearchState>(context, listen: false))

lib/ui/page/feed/suggestedUsers.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ class _SuggestedUsersState extends State<SuggestedUsers> {
7171
await state.followUsers();
7272
isLoading.value = false;
7373
},
74-
label: state.selectedusersCount < 5
75-
? '${5 - state.selectedusersCount} more to follow'
76-
: 'Follow ${state.selectedusersCount}',
74+
label: 'Follow ${state.selectedusersCount}',
7775
isWraped: true,
7876
borderRadius: 50,
7977
labelStyle: TextStyles.onPrimaryTitleText,

lib/ui/page/homePage.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ class _HomePageState extends State<HomePage> {
210210
final state = context.watch<AuthState>();
211211
context.read<SuggestionsState>().initUser(state.userModel);
212212

213-
if (context.watch<SuggestionsState>().displaySuggestions) {
213+
if (context
214+
.select<SuggestionsState, bool>((state) => state.displaySuggestions)) {
214215
return SuggestedUsers();
215216
}
216217

0 commit comments

Comments
 (0)