From b1874e28f88b7f9e29584c2918c09d5ebf7d135d Mon Sep 17 00:00:00 2001 From: Jacques Date: Thu, 4 Apr 2024 16:25:17 +0200 Subject: [PATCH] feat: Add bellstyle --- .dart_tool/package_config.json | 4 ++-- .dart_tool/package_config_subset | 4 ++-- example/pubspec.lock | 6 +++--- lib/flutter_notification_center.dart | 2 +- .../{notification_theme.dart => notification_style.dart} | 3 +++ lib/src/notification_bell.dart | 2 +- lib/src/services/local_notification_service.dart | 2 +- pubspec.lock | 6 +++--- pubspec.yaml | 2 +- 9 files changed, 17 insertions(+), 14 deletions(-) rename lib/src/models/{notification_theme.dart => notification_style.dart} (83%) diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 75a4e27..513b960 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -51,7 +51,7 @@ }, { "name": "flutter_animated_widgets", - "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/git/flutter_animated_widgets-0eb6ea4c2e64b757b468e23ee2055e27e8302397/", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/git/flutter_animated_widgets-65d8e31bfba38fca8973544312b430e131853a1a/", "packageUri": "lib/", "languageVersion": "2.18" }, @@ -182,7 +182,7 @@ "languageVersion": "3.3" } ], - "generated": "2024-04-04T07:46:25.501696Z", + "generated": "2024-04-04T14:21:58.133947Z", "generator": "pub", "generatorVersion": "3.3.3" } diff --git a/.dart_tool/package_config_subset b/.dart_tool/package_config_subset index d944a04..d3c7f5d 100644 --- a/.dart_tool/package_config_subset +++ b/.dart_tool/package_config_subset @@ -1,7 +1,7 @@ flutter_animated_widgets 2.18 -file:///Users/jacquesdoeleman/.pub-cache/git/flutter_animated_widgets-0eb6ea4c2e64b757b468e23ee2055e27e8302397/ -file:///Users/jacquesdoeleman/.pub-cache/git/flutter_animated_widgets-0eb6ea4c2e64b757b468e23ee2055e27e8302397/lib/ +file:///Users/jacquesdoeleman/.pub-cache/git/flutter_animated_widgets-65d8e31bfba38fca8973544312b430e131853a1a/ +file:///Users/jacquesdoeleman/.pub-cache/git/flutter_animated_widgets-65d8e31bfba38fca8973544312b430e131853a1a/lib/ async 2.18 file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/async-2.11.0/ diff --git a/example/pubspec.lock b/example/pubspec.lock index e50bdcc..041c1e7 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -66,11 +66,11 @@ packages: dependency: transitive description: path: "." - ref: "0.0.1" - resolved-ref: "0eb6ea4c2e64b757b468e23ee2055e27e8302397" + ref: "0.1.0" + resolved-ref: "65d8e31bfba38fca8973544312b430e131853a1a" url: "https://github.com/Iconica-Development/flutter_animated_widgets.git" source: git - version: "0.0.1" + version: "0.1.0" flutter_lints: dependency: "direct dev" description: diff --git a/lib/flutter_notification_center.dart b/lib/flutter_notification_center.dart index 570696f..f241eb0 100644 --- a/lib/flutter_notification_center.dart +++ b/lib/flutter_notification_center.dart @@ -8,7 +8,7 @@ export 'package:flutter_notification_center/src/services/notification_service.da export 'package:flutter_notification_center/src/services/local_notification_service.dart'; export 'package:flutter_notification_center/src/notification_center.dart'; export 'package:flutter_notification_center/src/models/notification.dart'; -export 'package:flutter_notification_center/src/models/notification_theme.dart'; +export 'package:flutter_notification_center/src/models/notification_style.dart'; export 'package:flutter_notification_center/src/models/notification_config.dart'; export 'package:flutter_notification_center/src/notification_bell.dart'; export 'package:flutter_notification_center/src/notification_bell_story.dart'; diff --git a/lib/src/models/notification_theme.dart b/lib/src/models/notification_style.dart similarity index 83% rename from lib/src/models/notification_theme.dart rename to lib/src/models/notification_style.dart index 6eb892d..fa85f1e 100644 --- a/lib/src/models/notification_theme.dart +++ b/lib/src/models/notification_style.dart @@ -1,6 +1,7 @@ // list_tile_theme.dart import 'package:flutter/material.dart'; +import 'package:flutter_animated_widgets/flutter_animated_widgets.dart'; // Define a theme class for customizing ListTile appearance class NotificationStyle { @@ -16,6 +17,7 @@ class NotificationStyle { final BoxDecoration? tileDecoration; final Widget Function()? emptyNotificationsBuilder; final TextStyle? appTitleTextStyle; + final AnimatedNotificationBellStyle bellStyle; const NotificationStyle({ this.titleTextStyle, @@ -30,5 +32,6 @@ class NotificationStyle { this.tileDecoration, this.emptyNotificationsBuilder, this.appTitleTextStyle, + this.bellStyle = const AnimatedNotificationBellStyle(), }); } diff --git a/lib/src/notification_bell.dart b/lib/src/notification_bell.dart index 31fb0ba..860eb07 100644 --- a/lib/src/notification_bell.dart +++ b/lib/src/notification_bell.dart @@ -39,7 +39,7 @@ class _NotificationBellState extends State { icon: AnimatedNotificationBell( duration: const Duration(seconds: 1), notificationCount: notificationAmount, - notificationIconSize: 45, + style: widget.config.style.bellStyle, ), ); } diff --git a/lib/src/services/local_notification_service.dart b/lib/src/services/local_notification_service.dart index 2a2c22f..941d840 100644 --- a/lib/src/services/local_notification_service.dart +++ b/lib/src/services/local_notification_service.dart @@ -84,7 +84,7 @@ class LocalNotificationService implements NotificationService { @override Future deleteScheduledNotification(NotificationModel notification) async { listOfPlannedNotifications = - listOfPlannedNotifications.where((n) => n != notification).toList(); + listOfPlannedNotifications.remove((n) => n != notification).toList(); print('Notification deleted: $notification'); } diff --git a/pubspec.lock b/pubspec.lock index e718625..bf9218a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -66,11 +66,11 @@ packages: dependency: "direct main" description: path: "." - ref: "0.0.1" - resolved-ref: "0eb6ea4c2e64b757b468e23ee2055e27e8302397" + ref: "0.1.0" + resolved-ref: "65d8e31bfba38fca8973544312b430e131853a1a" url: "https://github.com/Iconica-Development/flutter_animated_widgets.git" source: git - version: "0.0.1" + version: "0.1.0" flutter_lints: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 047b6fd..927fbf0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: flutter_animated_widgets: git: url: https://github.com/Iconica-Development/flutter_animated_widgets.git - ref: 0.0.1 + ref: 0.1.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons.