From 9a9083c2695d4a252cca4c84f470106bd8eb9f2f Mon Sep 17 00:00:00 2001 From: xMadKing Date: Wed, 3 Jan 2024 20:32:07 +0100 Subject: [PATCH] Fixed some issues before submission --- android/app/src/main/AndroidManifest.xml | 4 ++-- lib/main.dart | 2 +- lib/widgets/categorywidget.dart | 6 +++--- pubspec.lock | 16 ++++++++++++---- pubspec.yaml | 1 + 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 68ecd34..eb7133d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,4 @@ - - + + diff --git a/lib/main.dart b/lib/main.dart index 4e9a86a..4c36ee4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,7 +20,7 @@ void main() async { Future initNotifications() async { //this code is based on the documentation from the package AwesomeNotifications().initialize( // set the icon to null if you want to use the default app icon - 'assets/logo.png', + null, [ NotificationChannel( channelGroupKey: 'smartspend_notification_group', diff --git a/lib/widgets/categorywidget.dart b/lib/widgets/categorywidget.dart index 501ec51..69c707e 100644 --- a/lib/widgets/categorywidget.dart +++ b/lib/widgets/categorywidget.dart @@ -31,15 +31,15 @@ class _CategoryWidget extends State{ Future sendNotification() async { if (widget.number > widget.limit && !widget.notificationSent){ widget.notificationSent = true; - await AwesomeNotifications().createNotification( + AwesomeNotifications().createNotification( content: NotificationContent( id: 1, channelKey: 'smartspend_notification_channel', actionType: ActionType.Default, title: 'SmartSpend: Limit Exceeded!', - body: 'The ${widget.name} budget has been exceeded! Current spending: ${widget.number}', + body: 'Limit on ${widget.name} has been exceeded! Current Spending ${widget.number}.' ), - schedule: NotificationInterval(interval: 30,repeats: false) + schedule: NotificationInterval(interval: 5, repeats: false), ); } } diff --git a/pubspec.lock b/pubspec.lock index f044ea4..ca6b1f1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: archive - sha256: "7b875fd4a20b165a3084bd2d210439b22ebc653f21cea4842729c0c30c82596b" + sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" url: "https://pub.dev" source: hosted - version: "3.4.9" + version: "3.4.10" args: dependency: transitive description: @@ -53,10 +53,18 @@ packages: dependency: "direct main" description: name: awesome_notifications - sha256: "3eeb9e0cdfc72c7b4b83e9924da38ea86edd65a2af02bd5429aa41dce634ee90" + sha256: "20374499ae8e3c595f396afd43d7301c2765ebce64fbbd6ddd5f9e1b09c3f39b" url: "https://pub.dev" source: hosted - version: "0.8.3" + version: "0.9.0" + awesome_notifications_core: + dependency: "direct main" + description: + name: awesome_notifications_core + sha256: "0d67f3539aac87f9052b9eb204bdfbd00893a9d83b5975151098265428332bea" + url: "https://pub.dev" + source: hosted + version: "0.8.1" boolean_selector: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 655648d..970eb53 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -45,6 +45,7 @@ dependencies: flutter_launcher_icons: ^0.13.1 flutter_svg: ^2.0.9 quiver: ^3.2.1 + awesome_notifications_core: ^0.8.1 awesome_notifications: any