From d3a380523b64d98ac17a7f00dc000887c663e1be Mon Sep 17 00:00:00 2001 From: mike doornenbal Date: Mon, 29 Apr 2024 14:06:04 +0200 Subject: [PATCH] fix: fix animationcontroller --- CHANGELOG.md | 7 ++++++- .../example/pubspec.yaml | 5 ++++- .../lib/flutter_notification_center.dart | 1 + .../lib/src/models/notification_config.dart | 19 ++++++++++++------- .../lib/src/notification_bell.dart | 3 +-- .../flutter_notification_center/pubspec.yaml | 4 ++-- .../pubspec.yaml | 4 ++-- pubspec.yaml | 2 +- 8 files changed, 29 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52fb1f4..a2f2812 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -## [1.3.0] - 30 April 2024 +## [1.3.1] - 30 April 2024 + +* Fix Animationcontroller not disposing correctly. +* Updated flutter_animated_widgets to 0.1.1 + +## [1.3.0] - 23 April 2024 * Fix issue with pubspec in flutter_notification_center_firebase diff --git a/packages/flutter_notification_center/example/pubspec.yaml b/packages/flutter_notification_center/example/pubspec.yaml index 518eb91..1484957 100644 --- a/packages/flutter_notification_center/example/pubspec.yaml +++ b/packages/flutter_notification_center/example/pubspec.yaml @@ -26,7 +26,10 @@ dependencies: firebase_storage: ^11.0.14 flutter_notification_center: - path: ../ + git: + url: https://github.com/Iconica-Development/flutter_notification_center + ref: 1.3.0 + path: packages/flutter_notification_center flutter_notification_center_firebase: path: ../../flutter_notification_center_firebase diff --git a/packages/flutter_notification_center/lib/flutter_notification_center.dart b/packages/flutter_notification_center/lib/flutter_notification_center.dart index 8e84e2f..2b24131 100644 --- a/packages/flutter_notification_center/lib/flutter_notification_center.dart +++ b/packages/flutter_notification_center/lib/flutter_notification_center.dart @@ -14,3 +14,4 @@ export "src/notification_detail.dart"; export "src/notification_bell_story.dart"; export "src/notification_center.dart"; export "src/services/notification_service.dart"; +export "package:flutter_animated_widgets/flutter_animated_widgets.dart"; diff --git a/packages/flutter_notification_center/lib/src/models/notification_config.dart b/packages/flutter_notification_center/lib/src/models/notification_config.dart index 3bfa40a..8ab4527 100644 --- a/packages/flutter_notification_center/lib/src/models/notification_config.dart +++ b/packages/flutter_notification_center/lib/src/models/notification_config.dart @@ -10,13 +10,15 @@ class NotificationConfig { /// to use. The [style] parameter is optional and defines the style of the /// notification. The [translations] parameter is also optional and provides /// translations for notification messages. - const NotificationConfig( - {required this.service, - this.seperateNotificationsWithDivider = true, - this.translations = const NotificationTranslations(), - this.notificationWidgetBuilder, - this.showAsSnackBar = true, - this.enableNotificationPopups = true}); + const NotificationConfig({ + required this.service, + this.seperateNotificationsWithDivider = true, + this.translations = const NotificationTranslations(), + this.notificationWidgetBuilder, + this.showAsSnackBar = true, + this.enableNotificationPopups = true, + this.bellStyle = const AnimatedNotificationBellStyle(), + }); /// The notification service to use for delivering notifications. final NotificationService service; @@ -36,4 +38,7 @@ class NotificationConfig { /// Whether to show notification popups. final bool enableNotificationPopups; + + /// The style of the notification bell. + final AnimatedNotificationBellStyle bellStyle; } diff --git a/packages/flutter_notification_center/lib/src/notification_bell.dart b/packages/flutter_notification_center/lib/src/notification_bell.dart index 06e8d41..a0247d8 100644 --- a/packages/flutter_notification_center/lib/src/notification_bell.dart +++ b/packages/flutter_notification_center/lib/src/notification_bell.dart @@ -1,5 +1,4 @@ import "package:flutter/material.dart"; -import "package:flutter_animated_widgets/flutter_animated_widgets.dart"; import "../flutter_notification_center.dart"; /// A bell icon widget that displays the number of active notifications. @@ -55,7 +54,7 @@ class _NotificationBellState extends State { icon: AnimatedNotificationBell( duration: const Duration(seconds: 1), notificationCount: notificationAmount, - notificationIconSize: 45, + style: widget.config.bellStyle, ), ); } diff --git a/packages/flutter_notification_center/pubspec.yaml b/packages/flutter_notification_center/pubspec.yaml index cdc6e9a..bf353af 100644 --- a/packages/flutter_notification_center/pubspec.yaml +++ b/packages/flutter_notification_center/pubspec.yaml @@ -2,7 +2,7 @@ name: flutter_notification_center description: "A Flutter package for displaying notifications in a notification center." publish_to: 'none' -version: 1.3.0 +version: 1.3.1 environment: sdk: '>=3.3.2 <4.0.0' @@ -15,7 +15,7 @@ dependencies: flutter_animated_widgets: git: url: https://github.com/Iconica-Development/flutter_animated_widgets - ref: 0.0.1 + ref: 0.1.1 dev_dependencies: flutter_test: diff --git a/packages/flutter_notification_center_firebase/pubspec.yaml b/packages/flutter_notification_center_firebase/pubspec.yaml index 8b9b68e..db6b98f 100644 --- a/packages/flutter_notification_center_firebase/pubspec.yaml +++ b/packages/flutter_notification_center_firebase/pubspec.yaml @@ -2,7 +2,7 @@ name: flutter_notification_center_firebase description: "A new Flutter project." publish_to: "none" -version: 1.3.0 +version: 1.3.1 environment: sdk: ">=2.18.0 <3.0.0" @@ -24,7 +24,7 @@ dependencies: flutter_notification_center: git: url: https://github.com/Iconica-Development/flutter_notification_center - ref: 1.3.0 + ref: 1.3.1 path: packages/flutter_notification_center dev_dependencies: diff --git a/pubspec.yaml b/pubspec.yaml index 2f8e52f..9c548d9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: flutter_animated_widgets: git: url: https://github.com/Iconica-Development/flutter_animated_widgets - ref: 0.0.1 + ref: 0.1.1 dev_dependencies: flutter_test: