From 0289ca17565a8107cf63005a30a03e218e24cf3d Mon Sep 17 00:00:00 2001 From: Jacques Date: Thu, 4 Apr 2024 09:27:20 +0200 Subject: [PATCH] feat: Add some styling and translations --- .dart_tool/extension_discovery/README.md | 31 +++++ .dart_tool/extension_discovery/vs_code.json | 1 + .dart_tool/package_config.json | 60 +++++----- .dart_tool/package_config_subset | 120 +++++++++---------- .dart_tool/version | 2 +- lib/src/models/notification_theme.dart | 14 +-- lib/src/models/notification_translation.dart | 9 ++ lib/src/notification_center.dart | 77 +++++++----- 8 files changed, 182 insertions(+), 132 deletions(-) create mode 100644 .dart_tool/extension_discovery/README.md create mode 100644 .dart_tool/extension_discovery/vs_code.json create mode 100644 lib/src/models/notification_translation.dart diff --git a/.dart_tool/extension_discovery/README.md b/.dart_tool/extension_discovery/README.md new file mode 100644 index 0000000..9dc6757 --- /dev/null +++ b/.dart_tool/extension_discovery/README.md @@ -0,0 +1,31 @@ +Extension Discovery Cache +========================= + +This folder is used by `package:extension_discovery` to cache lists of +packages that contains extensions for other packages. + +DO NOT USE THIS FOLDER +---------------------- + + * Do not read (or rely) the contents of this folder. + * Do write to this folder. + +If you're interested in the lists of extensions stored in this folder use the +API offered by package `extension_discovery` to get this information. + +If this package doesn't work for your use-case, then don't try to read the +contents of this folder. It may change, and will not remain stable. + +Use package `extension_discovery` +--------------------------------- + +If you want to access information from this folder. + +Feel free to delete this folder +------------------------------- + +Files in this folder act as a cache, and the cache is discarded if the files +are older than the modification time of `.dart_tool/package_config.json`. + +Hence, it should never be necessary to clear this cache manually, if you find a +need to do please file a bug. diff --git a/.dart_tool/extension_discovery/vs_code.json b/.dart_tool/extension_discovery/vs_code.json new file mode 100644 index 0000000..ddc1a0f --- /dev/null +++ b/.dart_tool/extension_discovery/vs_code.json @@ -0,0 +1 @@ +{"version":2,"entries":[{"package":"flutter_notification_center","rootUri":"../","packageUri":"lib/"}]} \ No newline at end of file diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index f8ac162..2340ed7 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -3,169 +3,169 @@ "packages": [ { "name": "async", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/async-2.11.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/async-2.11.0", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "boolean_selector", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1", "packageUri": "lib/", "languageVersion": "2.17" }, { "name": "characters", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/characters-1.3.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/characters-1.3.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "clock", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/clock-1.1.1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/clock-1.1.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "collection", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/collection-1.18.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/collection-1.18.0", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "cupertino_icons", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.6", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.6", "packageUri": "lib/", "languageVersion": "2.19" }, { "name": "fake_async", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/fake_async-1.3.1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/fake_async-1.3.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "flutter", - "rootUri": "file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/packages/flutter", + "rootUri": "file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/packages/flutter", "packageUri": "lib/", "languageVersion": "3.2" }, { "name": "flutter_lints", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/flutter_lints-3.0.2", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/flutter_lints-3.0.2", "packageUri": "lib/", "languageVersion": "3.1" }, { "name": "flutter_test", - "rootUri": "file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/packages/flutter_test", + "rootUri": "file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/packages/flutter_test", "packageUri": "lib/", "languageVersion": "3.2" }, { "name": "intl", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/intl-0.17.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/intl-0.17.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "leak_tracker", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker-10.0.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker-10.0.0", "packageUri": "lib/", "languageVersion": "3.1" }, { "name": "leak_tracker_flutter_testing", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-2.0.1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-2.0.1", "packageUri": "lib/", "languageVersion": "3.1" }, { "name": "leak_tracker_testing", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker_testing-2.0.1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker_testing-2.0.1", "packageUri": "lib/", "languageVersion": "3.1" }, { "name": "lints", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/lints-3.0.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/lints-3.0.0", "packageUri": "lib/", "languageVersion": "3.0" }, { "name": "matcher", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/matcher-0.12.16+1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/matcher-0.12.16+1", "packageUri": "lib/", "languageVersion": "3.0" }, { "name": "material_color_utilities", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0", "packageUri": "lib/", "languageVersion": "2.17" }, { "name": "meta", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/meta-1.11.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/meta-1.11.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "path", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/path-1.9.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/path-1.9.0", "packageUri": "lib/", "languageVersion": "3.0" }, { "name": "sky_engine", - "rootUri": "file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/bin/cache/pkg/sky_engine", + "rootUri": "file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/bin/cache/pkg/sky_engine", "packageUri": "lib/", "languageVersion": "3.2" }, { "name": "source_span", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/source_span-1.10.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/source_span-1.10.0", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "stack_trace", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/stack_trace-1.11.1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/stack_trace-1.11.1", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "stream_channel", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/stream_channel-2.1.2", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/stream_channel-2.1.2", "packageUri": "lib/", "languageVersion": "2.19" }, { "name": "string_scanner", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/string_scanner-1.2.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/string_scanner-1.2.0", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "term_glyph", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/term_glyph-1.2.1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/term_glyph-1.2.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "test_api", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/test_api-0.6.1", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/test_api-0.6.1", "packageUri": "lib/", "languageVersion": "3.0" }, { "name": "vector_math", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/vector_math-2.1.4", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/vector_math-2.1.4", "packageUri": "lib/", "languageVersion": "2.14" }, { "name": "vm_service", - "rootUri": "file:///Users/vick/.pub-cache/hosted/pub.dev/vm_service-13.0.0", + "rootUri": "file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/vm_service-13.0.0", "packageUri": "lib/", "languageVersion": "3.0" }, @@ -176,7 +176,7 @@ "languageVersion": "3.3" } ], - "generated": "2024-04-03T12:38:14.672861Z", + "generated": "2024-04-03T12:50:20.344201Z", "generator": "pub", - "generatorVersion": "3.3.2" + "generatorVersion": "3.3.3" } diff --git a/.dart_tool/package_config_subset b/.dart_tool/package_config_subset index 3cd5fda..f8451b3 100644 --- a/.dart_tool/package_config_subset +++ b/.dart_tool/package_config_subset @@ -1,117 +1,117 @@ async 2.18 -file:///Users/vick/.pub-cache/hosted/pub.dev/async-2.11.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/async-2.11.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/async-2.11.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/async-2.11.0/lib/ boolean_selector 2.17 -file:///Users/vick/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/lib/ characters 2.12 -file:///Users/vick/.pub-cache/hosted/pub.dev/characters-1.3.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/characters-1.3.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/characters-1.3.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/characters-1.3.0/lib/ clock 2.12 -file:///Users/vick/.pub-cache/hosted/pub.dev/clock-1.1.1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/clock-1.1.1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/clock-1.1.1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/clock-1.1.1/lib/ collection 2.18 -file:///Users/vick/.pub-cache/hosted/pub.dev/collection-1.18.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/collection-1.18.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/collection-1.18.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/collection-1.18.0/lib/ cupertino_icons 2.19 -file:///Users/vick/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.6/ -file:///Users/vick/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.6/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.6/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.6/lib/ fake_async 2.12 -file:///Users/vick/.pub-cache/hosted/pub.dev/fake_async-1.3.1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/fake_async-1.3.1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/fake_async-1.3.1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/fake_async-1.3.1/lib/ flutter_lints 3.1 -file:///Users/vick/.pub-cache/hosted/pub.dev/flutter_lints-3.0.2/ -file:///Users/vick/.pub-cache/hosted/pub.dev/flutter_lints-3.0.2/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/flutter_lints-3.0.2/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/flutter_lints-3.0.2/lib/ intl 2.12 -file:///Users/vick/.pub-cache/hosted/pub.dev/intl-0.17.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/intl-0.17.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/intl-0.17.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/intl-0.17.0/lib/ leak_tracker 3.1 -file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker-10.0.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker-10.0.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker-10.0.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker-10.0.0/lib/ leak_tracker_flutter_testing 3.1 -file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-2.0.1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-2.0.1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-2.0.1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-2.0.1/lib/ leak_tracker_testing 3.1 -file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker_testing-2.0.1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/leak_tracker_testing-2.0.1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker_testing-2.0.1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/leak_tracker_testing-2.0.1/lib/ lints 3.0 -file:///Users/vick/.pub-cache/hosted/pub.dev/lints-3.0.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/lints-3.0.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/lints-3.0.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/lints-3.0.0/lib/ matcher 3.0 -file:///Users/vick/.pub-cache/hosted/pub.dev/matcher-0.12.16+1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/matcher-0.12.16+1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/matcher-0.12.16+1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/matcher-0.12.16+1/lib/ material_color_utilities 2.17 -file:///Users/vick/.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/material_color_utilities-0.8.0/lib/ meta 2.12 -file:///Users/vick/.pub-cache/hosted/pub.dev/meta-1.11.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/meta-1.11.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/meta-1.11.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/meta-1.11.0/lib/ path 3.0 -file:///Users/vick/.pub-cache/hosted/pub.dev/path-1.9.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/path-1.9.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/path-1.9.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/path-1.9.0/lib/ source_span 2.18 -file:///Users/vick/.pub-cache/hosted/pub.dev/source_span-1.10.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/source_span-1.10.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/source_span-1.10.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/source_span-1.10.0/lib/ stack_trace 2.18 -file:///Users/vick/.pub-cache/hosted/pub.dev/stack_trace-1.11.1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/stack_trace-1.11.1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/stack_trace-1.11.1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/stack_trace-1.11.1/lib/ stream_channel 2.19 -file:///Users/vick/.pub-cache/hosted/pub.dev/stream_channel-2.1.2/ -file:///Users/vick/.pub-cache/hosted/pub.dev/stream_channel-2.1.2/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/stream_channel-2.1.2/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/stream_channel-2.1.2/lib/ string_scanner 2.18 -file:///Users/vick/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/lib/ term_glyph 2.12 -file:///Users/vick/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/lib/ test_api 3.0 -file:///Users/vick/.pub-cache/hosted/pub.dev/test_api-0.6.1/ -file:///Users/vick/.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/test_api-0.6.1/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/ vector_math 2.14 -file:///Users/vick/.pub-cache/hosted/pub.dev/vector_math-2.1.4/ -file:///Users/vick/.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/vector_math-2.1.4/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/ vm_service 3.0 -file:///Users/vick/.pub-cache/hosted/pub.dev/vm_service-13.0.0/ -file:///Users/vick/.pub-cache/hosted/pub.dev/vm_service-13.0.0/lib/ -flutter_notification_center -3.3 -file:///Users/vick/Desktop/Flutter%20Projects/components/flutter_notification_center/ -file:///Users/vick/Desktop/Flutter%20Projects/components/flutter_notification_center/lib/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/vm_service-13.0.0/ +file:///Users/jacquesdoeleman/.pub-cache/hosted/pub.dev/vm_service-13.0.0/lib/ sky_engine 3.2 -file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/bin/cache/pkg/sky_engine/ -file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/bin/cache/pkg/sky_engine/lib/ +file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/bin/cache/pkg/sky_engine/ +file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/bin/cache/pkg/sky_engine/lib/ flutter 3.2 -file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/packages/flutter/ -file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/packages/flutter/lib/ +file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/packages/flutter/ +file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/packages/flutter/lib/ flutter_test 3.2 -file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/packages/flutter_test/ -file:///Users/vick/Library/brew/Caskroom/flutter/3.13.3/flutter/packages/flutter_test/lib/ +file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/packages/flutter_test/ +file:///Users/jacquesdoeleman/Develop/Frameworks/flutter/packages/flutter_test/lib/ +flutter_notification_center +3.3 +file:///Users/jacquesdoeleman/Develop/Iconica/Projects/Packages/flutter_notification_center/ +file:///Users/jacquesdoeleman/Develop/Iconica/Projects/Packages/flutter_notification_center/lib/ 2 diff --git a/.dart_tool/version b/.dart_tool/version index 2fe414e..0bc8e96 100644 --- a/.dart_tool/version +++ b/.dart_tool/version @@ -1 +1 @@ -3.19.4 \ No newline at end of file +3.19.5 \ No newline at end of file diff --git a/lib/src/models/notification_theme.dart b/lib/src/models/notification_theme.dart index 6a68173..6eb892d 100644 --- a/lib/src/models/notification_theme.dart +++ b/lib/src/models/notification_theme.dart @@ -10,13 +10,12 @@ class NotificationStyle { final Color? leadingIconColor; final Color? trailingIconColor; final EdgeInsets? contentPadding; - final double? titleFontSize; - final double? subtitleFontSize; - final FontWeight? titleFontWeight; - final FontWeight? subtitleFontWeight; final TextAlign? titleTextAlign; final TextAlign? subtitleTextAlign; final bool? dense; + final BoxDecoration? tileDecoration; + final Widget Function()? emptyNotificationsBuilder; + final TextStyle? appTitleTextStyle; const NotificationStyle({ this.titleTextStyle, @@ -25,12 +24,11 @@ class NotificationStyle { this.leadingIconColor, this.trailingIconColor, this.contentPadding, - this.titleFontSize, - this.subtitleFontSize, - this.titleFontWeight, - this.subtitleFontWeight, this.titleTextAlign, this.subtitleTextAlign, this.dense, + this.tileDecoration, + this.emptyNotificationsBuilder, + this.appTitleTextStyle, }); } diff --git a/lib/src/models/notification_translation.dart b/lib/src/models/notification_translation.dart new file mode 100644 index 0000000..4806500 --- /dev/null +++ b/lib/src/models/notification_translation.dart @@ -0,0 +1,9 @@ +class NotificationTranslations { + final String appBarTitle; + final String noNotifications; + + const NotificationTranslations({ + this.appBarTitle = 'Notification Center', + this.noNotifications = 'No unread notifications available.', + }); +} diff --git a/lib/src/notification_center.dart b/lib/src/notification_center.dart index 0674485..04c1a15 100644 --- a/lib/src/notification_center.dart +++ b/lib/src/notification_center.dart @@ -1,17 +1,20 @@ import 'package:flutter/material.dart'; import 'package:flutter_notification_center/src/models/notification.dart'; import 'package:flutter_notification_center/src/models/notification_theme.dart'; +import 'package:flutter_notification_center/src/models/notification_translation.dart'; import 'package:flutter_notification_center/src/services/notification_service.dart'; import 'package:intl/intl.dart'; class NotificationCenter extends StatefulWidget { final NotificationService notificationCenterService; final NotificationStyle? notificationTheme; + final NotificationTranslations translations; const NotificationCenter({ super.key, required this.notificationCenterService, this.notificationTheme, + this.translations = const NotificationTranslations(), }); @override @@ -35,7 +38,10 @@ class _NotificationCenterState extends State { return Scaffold( appBar: AppBar( - title: const Text('Notification Center'), + title: Text( + widget.translations.appBarTitle, + style: widget.notificationTheme?.appTitleTextStyle, + ), centerTitle: true, leading: IconButton( icon: const Icon(Icons.arrow_back), @@ -45,45 +51,50 @@ class _NotificationCenterState extends State { ), ), body: unreadNotifications.isEmpty - ? const Center( - child: Text('No unread notifications available.'), - ) + ? widget.notificationTheme?.emptyNotificationsBuilder?.call() ?? + Center( + child: Text(widget.translations.appBarTitle), + ) : ListView.builder( itemCount: unreadNotifications.length, itemBuilder: (context, index) { final notification = unreadNotifications[index]; final formattedDateTime = DateFormat('yyyy-MM-dd HH:mm') .format(notification.dateTime); - return ListTile( - title: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - notification.title, - style: widget.notificationTheme?.titleTextStyle ?? - const TextStyle(), - ), - Text( - notification.body, - style: widget.notificationTheme?.subtitleTextStyle ?? - const TextStyle(), - ), - Text( - formattedDateTime, - style: const TextStyle( - fontSize: 12, - color: Colors.grey, + return Container( + decoration: widget.notificationTheme?.tileDecoration, + child: ListTile( + title: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + notification.title, + style: widget.notificationTheme?.titleTextStyle ?? + const TextStyle(), ), - ), - ], - ), - trailing: IconButton( - icon: const Icon(Icons.clear), - onPressed: () { - setState(() { - notification.isRead = true; - }); - }, + Text( + notification.body, + style: widget.notificationTheme?.subtitleTextStyle ?? + const TextStyle(), + ), + Text( + formattedDateTime, + style: const TextStyle( + fontSize: 12, + color: Colors.grey, + ), + ), + ], + ), + trailing: IconButton( + icon: const Icon(Icons.clear), + onPressed: () { + setState(() { + notification.isRead = true; + }); + }, + ), ), ); },