From cd597066c2fdb8dffb0e890db46c4bc3a8b4b91e Mon Sep 17 00:00:00 2001 From: vkprogrammer-001 Date: Wed, 7 Feb 2024 16:31:49 +0530 Subject: [PATCH 1/6] Fix for Future Date Validation in Beacon Project --- lib/services/local_notification.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/services/local_notification.dart b/lib/services/local_notification.dart index 623ad5ae..337c9604 100644 --- a/lib/services/local_notification.dart +++ b/lib/services/local_notification.dart @@ -46,6 +46,13 @@ class LocalNotification { } Future scheduleNotification(Beacon beacon) async { + DateTime now = DateTime.now(); + DateTime beaconStart = DateTime.fromMillisecondsSinceEpoch(beacon.startsAt); + + if (beaconStart.difference(now).inMinutes < 0) { + print('Beacon start time must be in the future'); + return; + } await flutterLocalNotificationsPlugin.zonedSchedule( beacon.id.hashCode, 'Hike ' + beacon.title + ' has started', From c0b04d0d5dac79d49008997cd4a2ba32d06d63ce Mon Sep 17 00:00:00 2001 From: vkprogrammer-001 Date: Wed, 7 Feb 2024 17:10:30 +0530 Subject: [PATCH 2/6] Fix for Future Date Validation in Beacon Project --- lib/services/local_notification.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/local_notification.dart b/lib/services/local_notification.dart index 337c9604..5748665b 100644 --- a/lib/services/local_notification.dart +++ b/lib/services/local_notification.dart @@ -49,8 +49,8 @@ class LocalNotification { DateTime now = DateTime.now(); DateTime beaconStart = DateTime.fromMillisecondsSinceEpoch(beacon.startsAt); - if (beaconStart.difference(now).inMinutes < 0) { - print('Beacon start time must be in the future'); + if (beaconStart.difference(now).inHours < 1) { + print('Beacon start time must be at least an hour from now'); return; } await flutterLocalNotificationsPlugin.zonedSchedule( From 4f8ef0a7426f88d54bc74d7a9f5a6afc846a25b1 Mon Sep 17 00:00:00 2001 From: vkprogrammer-001 Date: Fri, 9 Feb 2024 01:55:10 +0530 Subject: [PATCH 3/6] Enhancement of Exit Functionality in Beacon Project --- lib/views/group_screen.dart | 44 +------------------------------------ 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/lib/views/group_screen.dart b/lib/views/group_screen.dart index 68be5672..64067448 100644 --- a/lib/views/group_screen.dart +++ b/lib/views/group_screen.dart @@ -87,49 +87,7 @@ class _GroupScreenState extends State Align( alignment: Alignment(0.9, -0.8), child: FloatingActionButton( - onPressed: () => showDialog( - context: context, - builder: (context) => AlertDialog( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - actionsAlignment: - MainAxisAlignment.spaceEvenly, - title: Text( - (userConfig.currentUser.isGuest) - ? 'Create Account' - : 'Logout', - style: TextStyle( - fontSize: 25, color: kYellow), - ), - content: Text( - (userConfig.currentUser.isGuest) - ? 'Would you like to create an account?' - : 'Are you sure you wanna logout?', - style: TextStyle( - fontSize: 16, color: kBlack), - ), - actions: [ - HikeButton( - buttonHeight: 2.5.h, - buttonWidth: 8.w, - onTap: () => - Navigator.of(context).pop(false), - text: 'No', - textSize: 18.0, - ), - HikeButton( - buttonHeight: 2.5.h, - buttonWidth: 8.w, - onTap: () { - navigationService.pop(); - model.logout(); - }, - text: 'Yes', - textSize: 18.0, - ), - ], - )), + onPressed: () => Navigator.of(context).pop(), backgroundColor: kYellow, child: (userConfig.currentUser.isGuest) ? Icon(Icons.person) From 6b5f41057fbef06e476ea7f84961da29924b325e Mon Sep 17 00:00:00 2001 From: vipin kumar <143318563+vkprogrammer-001@users.noreply.github.com> Date: Fri, 9 Feb 2024 02:14:10 +0530 Subject: [PATCH 4/6] Update local_notification.dart --- lib/services/local_notification.dart | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/services/local_notification.dart b/lib/services/local_notification.dart index 5748665b..623ad5ae 100644 --- a/lib/services/local_notification.dart +++ b/lib/services/local_notification.dart @@ -46,13 +46,6 @@ class LocalNotification { } Future scheduleNotification(Beacon beacon) async { - DateTime now = DateTime.now(); - DateTime beaconStart = DateTime.fromMillisecondsSinceEpoch(beacon.startsAt); - - if (beaconStart.difference(now).inHours < 1) { - print('Beacon start time must be at least an hour from now'); - return; - } await flutterLocalNotificationsPlugin.zonedSchedule( beacon.id.hashCode, 'Hike ' + beacon.title + ' has started', From efd778594035b191b0c5fb8d957acabe927243c0 Mon Sep 17 00:00:00 2001 From: vkprogrammer-001 Date: Mon, 12 Feb 2024 17:00:58 +0530 Subject: [PATCH 5/6] [change] new_back_button --- lib/views/group_screen.dart | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/views/group_screen.dart b/lib/views/group_screen.dart index 64067448..23a17a14 100644 --- a/lib/views/group_screen.dart +++ b/lib/views/group_screen.dart @@ -61,15 +61,6 @@ class _GroupScreenState extends State MediaQuery.of(context).size.height - 200), painter: ShapePainter(), ), - // Creating a back button - // Align( - // alignment: Alignment(-0.9, -0.8), - // child: FloatingActionButton( - // onPressed: () => navigationService.pop(), - // backgroundColor: kYellow, - // child: Icon(Icons.arrow_back_rounded), - // ), - // ), Align( alignment: Alignment(-0.7, -0.95), child: Container( From 9a1d3aac8c09735fdd8eb5bc0f2c6f486d4aefd6 Mon Sep 17 00:00:00 2001 From: vkprogrammer-001 Date: Mon, 12 Feb 2024 17:06:48 +0530 Subject: [PATCH 6/6] [change] home to back button --- lib/views/group_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/views/group_screen.dart b/lib/views/group_screen.dart index 23a17a14..0ca23327 100644 --- a/lib/views/group_screen.dart +++ b/lib/views/group_screen.dart @@ -82,7 +82,7 @@ class _GroupScreenState extends State backgroundColor: kYellow, child: (userConfig.currentUser.isGuest) ? Icon(Icons.person) - : Icon(Icons.logout), + : Icon(Icons.arrow_back), ), ), Padding(