Skip to content

Commit

Permalink
final notfication
Browse files Browse the repository at this point in the history
  • Loading branch information
sambitraze committed Jun 6, 2021
1 parent 5d5cf1e commit 6663539
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions lib/services/NotificationService.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ class NotificationService {
"title": title,
"message": message,
"deviceToken": deviceToken,
"data": {"name": "sambit"}
"data": {
"startTime": DateTime.now().toString(),
"endTime": DateTime.now().add(Duration(seconds: 10)).toString()
}
},
);
http.Response response = await http.post(
Expand Down Expand Up @@ -63,6 +66,4 @@ class NotificationService {
return response.body;
}
}


}
10 changes: 5 additions & 5 deletions lib/views/Admin/landingPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class _LandingScreenState extends State<LandingScreen> {
Text(message.notification.body),
title: Text(message.notification.title),
));
// if (message.data != null) {
// print('Message also contained a notification: ${message.notification}');
// reminderService.sheduledNotification(
// message.data['startTime'], message.data['endTime']);
// }
if (message.data != null) {
print('Message also contained a notification: ${message.notification}');
reminderService.sheduledNotification(
message.data['startTime'], message.data['endTime']);
}
});
_selectedIndex = widget.selectedIndex;
}
Expand Down

0 comments on commit 6663539

Please sign in to comment.