diff --git a/lib/pages/courses/service/courses_background_service.dart b/lib/pages/courses/service/courses_background_service.dart index d886bdf..e227f0f 100644 --- a/lib/pages/courses/service/courses_background_service.dart +++ b/lib/pages/courses/service/courses_background_service.dart @@ -25,13 +25,15 @@ class CoursesBackgroundService { } }); - LocalNotifierService().showNotification( - id: LocalNotificationStatusManager().getNextId(), - title: "Class! Class! Class! ${Emojis.building_school}", - body: - "Hey, you have $coursestoday classes today ${Emojis.smile_face_screaming_in_fear}", - channelKey: LocalNotificationChannelType.reminders.channelKey, - ); + if (coursestoday > 0) { + LocalNotifierService().showNotification( + id: LocalNotificationStatusManager().getNextId(), + title: "Class! Class! Class! ${Emojis.building_school}", + body: + "Hey, you have $coursestoday classes today ${Emojis.smile_face_screaming_in_fear}", + channelKey: LocalNotificationChannelType.reminders.channelKey, + ); + } }); } } diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index 9efdce3..7b69bb7 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -260,7 +260,7 @@ class _SettingsPageState extends State { await userController.deleteUser(); await LocalNotifierService().showNotification( id: 0, - title: "Damn", + title: "Goodbye see you soon!", notificationType: NotificationType.bigText, body: "Goodbye, your entire user information has been deleted from our platform, it was a pleasure being a part of your academic journey", @@ -269,11 +269,11 @@ class _SettingsPageState extends State { ); if (context.mounted) { - Navigator.pop(context); - Navigator.of(context).pushReplacement( + Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute( - builder: (context) => const Academia(), + builder: (context) => const IntroPage(), ), + (predicate) => false, ); } }, @@ -317,11 +317,12 @@ class _SettingsPageState extends State { ); if (context.mounted) { Navigator.pop(context); - Navigator.of(context).pushReplacement( + Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute( builder: (context) => - const Academia(), + const IntroPage(), ), + (predicate) => false, ); } }, diff --git a/lib/pages/util_pages/intro_page.dart b/lib/pages/util_pages/intro_page.dart index de2a2f5..18a33c1 100644 --- a/lib/pages/util_pages/intro_page.dart +++ b/lib/pages/util_pages/intro_page.dart @@ -50,7 +50,7 @@ class IntroPage extends StatelessWidget { ), floatingActionButton: FutureBuilder( future: Future.delayed( - const Duration(seconds: 3), + const Duration(seconds: 7), ), builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.done) { diff --git a/lib/tools/chirp/pages/post_create_page.dart b/lib/tools/chirp/pages/post_create_page.dart index dc18b4c..10ac414 100644 --- a/lib/tools/chirp/pages/post_create_page.dart +++ b/lib/tools/chirp/pages/post_create_page.dart @@ -15,11 +15,13 @@ class _PostCreatePageState extends State { final TextEditingController bodyController = TextEditingController(); final List imageFiles = []; final ChirpController chirpController = Get.find(); + bool isLoading = false; @override Widget build(BuildContext context) { return Scaffold( + resizeToAvoidBottomInset: true, appBar: AppBar( leading: IconButton( onPressed: () { @@ -121,6 +123,7 @@ class _PostCreatePageState extends State { ); postresponse.fold((l) { showDialog( + barrierDismissible: false, context: context, builder: (context) => AlertDialog( title: const Text("Error"), @@ -135,6 +138,7 @@ class _PostCreatePageState extends State { )); }, (r) { showDialog( + barrierDismissible: false, context: context, builder: (context) => AlertDialog( title: const Text("Success"), @@ -144,6 +148,7 @@ class _PostCreatePageState extends State { FilledButton( onPressed: () { Navigator.pop(context); + Navigator.pop(context); }, child: const Text("okay")) ], diff --git a/lib/tools/chirp/widgets/post_card.dart b/lib/tools/chirp/widgets/post_card.dart index d031b3a..4a3b0d5 100644 --- a/lib/tools/chirp/widgets/post_card.dart +++ b/lib/tools/chirp/widgets/post_card.dart @@ -76,9 +76,30 @@ class _PostCardState extends State { ), ), const Spacer(), - IconButton( - onPressed: () {}, - icon: const Icon(Ionicons.ellipsis_vertical), + Visibility( + visible: widget.post.upvotes > 1000 ? true : false, + child: IconButton( + onPressed: () { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: const Text("Awesome post ✨✨"), + content: const Text( + "This post has been handpicked by the community"), + actions: [ + FilledButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text("Cool"), + ), + ], + ); + }); + }, + icon: const Icon(Ionicons.ribbon), + ), ), ], ), diff --git a/lib/workers/background_worker.dart b/lib/workers/background_worker.dart index 178ffe3..4cdb160 100644 --- a/lib/workers/background_worker.dart +++ b/lib/workers/background_worker.dart @@ -47,9 +47,9 @@ class BackgroundWorker { BackgroundConfig.coursesIDentifier, BackgroundConfig.coursesIDentifier, initialDelay: timeUntilNextTarget( - DateTime(now.year, now.month, now.day, 12, 0, 0), + DateTime(now.year, now.month, now.day, 7, 0, 0), ), - frequency: const Duration(minutes: 15), + frequency: const Duration(hours: 8), ); /// Todos task that is suppossed to run after every 24 hours at 8 am @@ -57,7 +57,7 @@ class BackgroundWorker { BackgroundConfig.todosIDentifier, BackgroundConfig.todosIDentifier, initialDelay: const Duration(seconds: 10), - frequency: const Duration(minutes: 15), + frequency: const Duration(hours: 8), ); } }