diff --git a/.DS_Store b/.DS_Store index 35d64bee..71be7425 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 08f5684b..a32d3d53 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -3,13 +3,13 @@ "packages": [ { "name": "_fe_analyzer_shared", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-59.0.0", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-61.0.0", "packageUri": "lib/", "languageVersion": "2.17" }, { "name": "analyzer", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/analyzer-5.11.1", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/analyzer-5.13.0", "packageUri": "lib/", "languageVersion": "2.19" }, @@ -69,7 +69,7 @@ }, { "name": "collection", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/collection-1.17.2", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/collection-1.18.0", "packageUri": "lib/", "languageVersion": "2.18" }, @@ -79,12 +79,6 @@ "packageUri": "lib/", "languageVersion": "2.18" }, - { - "name": "coverage", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/coverage-1.6.3", - "packageUri": "lib/", - "languageVersion": "2.18" - }, { "name": "crypto", "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/crypto-3.0.2", @@ -119,31 +113,25 @@ "name": "flutter", "rootUri": "file:///Users/rafaelsetragni/Development/flutter/packages/flutter", "packageUri": "lib/", - "languageVersion": "3.0" + "languageVersion": "3.2" }, { "name": "flutter_lints", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/flutter_lints-2.0.3", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/flutter_lints-3.0.1", "packageUri": "lib/", - "languageVersion": "2.19" + "languageVersion": "3.0" }, { "name": "flutter_test", "rootUri": "file:///Users/rafaelsetragni/Development/flutter/packages/flutter_test", "packageUri": "lib/", - "languageVersion": "3.0" + "languageVersion": "3.2" }, { "name": "flutter_web_plugins", "rootUri": "file:///Users/rafaelsetragni/Development/flutter/packages/flutter_web_plugins", "packageUri": "lib/", - "languageVersion": "3.0" - }, - { - "name": "frontend_server_client", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/frontend_server_client-3.2.0", - "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "3.2" }, { "name": "glob", @@ -151,41 +139,17 @@ "packageUri": "lib/", "languageVersion": "2.15" }, - { - "name": "http_multi_server", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/http_multi_server-3.2.1", - "packageUri": "lib/", - "languageVersion": "2.12" - }, - { - "name": "http_parser", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/http_parser-4.0.2", - "packageUri": "lib/", - "languageVersion": "2.12" - }, { "name": "intl", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/intl-0.18.1", - "packageUri": "lib/", - "languageVersion": "2.12" - }, - { - "name": "io", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/io-1.0.4", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/intl-0.19.0", "packageUri": "lib/", - "languageVersion": "2.12" - }, - { - "name": "js", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/js-0.6.7", - "packageUri": "lib/", - "languageVersion": "2.19" + "languageVersion": "3.0" }, { "name": "lints", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/lints-2.0.1", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/lints-3.0.0", "packageUri": "lib/", - "languageVersion": "2.17" + "languageVersion": "3.0" }, { "name": "logging", @@ -207,31 +171,19 @@ }, { "name": "meta", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/meta-1.9.1", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/meta-1.10.0", "packageUri": "lib/", "languageVersion": "2.12" }, - { - "name": "mime", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mime-1.0.4", - "packageUri": "lib/", - "languageVersion": "2.18" - }, { "name": "mockito", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mockito-5.4.2", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mockito-5.4.4", "packageUri": "lib/", - "languageVersion": "2.19" + "languageVersion": "3.1" }, { "name": "mocktail", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mocktail-1.0.0", - "packageUri": "lib/", - "languageVersion": "2.12" - }, - { - "name": "node_preamble", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/node_preamble-2.0.2", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mocktail-1.0.2", "packageUri": "lib/", "languageVersion": "2.12" }, @@ -249,15 +201,9 @@ }, { "name": "plugin_platform_interface", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.6", - "packageUri": "lib/", - "languageVersion": "2.19" - }, - { - "name": "pool", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/pool-1.5.1", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.7", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "3.0" }, { "name": "pub_semver", @@ -265,35 +211,11 @@ "packageUri": "lib/", "languageVersion": "2.17" }, - { - "name": "shelf", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf-1.4.0", - "packageUri": "lib/", - "languageVersion": "2.17" - }, - { - "name": "shelf_packages_handler", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_packages_handler-3.0.1", - "packageUri": "lib/", - "languageVersion": "2.14" - }, - { - "name": "shelf_static", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_static-1.1.1", - "packageUri": "lib/", - "languageVersion": "2.14" - }, - { - "name": "shelf_web_socket", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_web_socket-1.0.3", - "packageUri": "lib/", - "languageVersion": "2.17" - }, { "name": "sky_engine", "rootUri": "file:///Users/rafaelsetragni/Development/flutter/bin/cache/pkg/sky_engine", "packageUri": "lib/", - "languageVersion": "3.0" + "languageVersion": "3.2" }, { "name": "source_gen", @@ -301,18 +223,6 @@ "packageUri": "lib/", "languageVersion": "2.18" }, - { - "name": "source_map_stack_trace", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_map_stack_trace-2.1.1", - "packageUri": "lib/", - "languageVersion": "2.12" - }, - { - "name": "source_maps", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_maps-0.10.12", - "packageUri": "lib/", - "languageVersion": "2.18" - }, { "name": "source_span", "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_span-1.10.0", @@ -321,15 +231,15 @@ }, { "name": "stack_trace", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stack_trace-1.11.0", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stack_trace-1.11.1", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "stream_channel", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stream_channel-2.1.1", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stream_channel-2.1.2", "packageUri": "lib/", - "languageVersion": "2.14" + "languageVersion": "2.19" }, { "name": "string_scanner", @@ -343,23 +253,11 @@ "packageUri": "lib/", "languageVersion": "2.12" }, - { - "name": "test", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test-1.24.3", - "packageUri": "lib/", - "languageVersion": "2.18" - }, { "name": "test_api", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_api-0.6.0", - "packageUri": "lib/", - "languageVersion": "2.18" - }, - { - "name": "test_core", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_core-0.5.3", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_api-0.6.1", "packageUri": "lib/", - "languageVersion": "2.18" + "languageVersion": "3.0" }, { "name": "typed_data", @@ -373,12 +271,6 @@ "packageUri": "lib/", "languageVersion": "2.14" }, - { - "name": "vm_service", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/vm_service-9.4.0", - "packageUri": "lib/", - "languageVersion": "2.15" - }, { "name": "watcher", "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/watcher-1.0.2", @@ -387,21 +279,9 @@ }, { "name": "web", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web-0.1.4-beta", - "packageUri": "lib/", - "languageVersion": "3.1" - }, - { - "name": "web_socket_channel", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web_socket_channel-2.4.0", - "packageUri": "lib/", - "languageVersion": "2.15" - }, - { - "name": "webkit_inspection_protocol", - "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/webkit_inspection_protocol-1.2.0", + "rootUri": "file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web-0.3.0", "packageUri": "lib/", - "languageVersion": "2.12" + "languageVersion": "3.2" }, { "name": "yaml", @@ -416,7 +296,7 @@ "languageVersion": "2.19" } ], - "generated": "2023-10-02T20:03:17.343139Z", + "generated": "2023-12-18T22:12:34.996887Z", "generator": "pub", - "generatorVersion": "3.1.3" + "generatorVersion": "3.2.0" } diff --git a/.dart_tool/package_config_subset b/.dart_tool/package_config_subset index 5eb995a4..6d965384 100644 --- a/.dart_tool/package_config_subset +++ b/.dart_tool/package_config_subset @@ -1,11 +1,11 @@ _fe_analyzer_shared 2.17 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-59.0.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-59.0.0/lib/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-61.0.0/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-61.0.0/lib/ analyzer 2.19 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/analyzer-5.11.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/analyzer-5.11.1/lib/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/analyzer-5.13.0/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/analyzer-5.13.0/lib/ args 2.18 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/args-2.4.0/ @@ -44,16 +44,12 @@ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/code_builder-4.6.0/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/code_builder-4.6.0/lib/ collection 2.18 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/collection-1.17.2/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/collection-1.17.2/lib/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/collection-1.18.0/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/collection-1.18.0/lib/ convert 2.18 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/convert-3.1.1/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/convert-3.1.1/lib/ -coverage -2.18 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/coverage-1.6.3/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/coverage-1.6.3/lib/ crypto 2.14 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/crypto-3.0.2/ @@ -75,41 +71,21 @@ fixnum file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/fixnum-1.1.0/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/fixnum-1.1.0/lib/ flutter_lints -2.19 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/flutter_lints-2.0.3/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/flutter_lints-2.0.3/lib/ -frontend_server_client -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/frontend_server_client-3.2.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/frontend_server_client-3.2.0/lib/ +3.0 +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/flutter_lints-3.0.1/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/flutter_lints-3.0.1/lib/ glob 2.15 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/glob-2.1.1/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/glob-2.1.1/lib/ -http_multi_server -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/http_multi_server-3.2.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/http_multi_server-3.2.1/lib/ -http_parser -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/http_parser-4.0.2/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/http_parser-4.0.2/lib/ intl -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/intl-0.18.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/intl-0.18.1/lib/ -io -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/io-1.0.4/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/io-1.0.4/lib/ -js -2.19 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/js-0.6.7/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/js-0.6.7/lib/ +3.0 +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/intl-0.19.0/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/intl-0.19.0/lib/ lints -2.17 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/lints-2.0.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/lints-2.0.1/lib/ +3.0 +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/lints-3.0.0/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/lints-3.0.0/lib/ logging 2.18 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/logging-1.1.1/ @@ -124,24 +100,16 @@ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/material_color_utilities- file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/material_color_utilities-0.5.0/lib/ meta 2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/meta-1.9.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/meta-1.9.1/lib/ -mime -2.18 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mime-1.0.4/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mime-1.0.4/lib/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/meta-1.10.0/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/meta-1.10.0/lib/ mockito -2.19 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mockito-5.4.2/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mockito-5.4.2/lib/ +3.1 +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mockito-5.4.4/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mockito-5.4.4/lib/ mocktail 2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mocktail-1.0.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mocktail-1.0.0/lib/ -node_preamble -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/node_preamble-2.0.2/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/node_preamble-2.0.2/lib/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mocktail-1.0.2/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/mocktail-1.0.2/lib/ package_config 2.12 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/package_config-2.1.0/ @@ -151,57 +119,29 @@ path file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/path-1.8.3/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/path-1.8.3/lib/ plugin_platform_interface -2.19 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.6/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.6/lib/ -pool -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/pool-1.5.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/pool-1.5.1/lib/ +3.0 +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.7/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.7/lib/ pub_semver 2.17 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/pub_semver-2.1.3/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/pub_semver-2.1.3/lib/ -shelf -2.17 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf-1.4.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf-1.4.0/lib/ -shelf_packages_handler -2.14 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_packages_handler-3.0.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_packages_handler-3.0.1/lib/ -shelf_static -2.14 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_static-1.1.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_static-1.1.1/lib/ -shelf_web_socket -2.17 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_web_socket-1.0.3/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/shelf_web_socket-1.0.3/lib/ source_gen 2.18 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_gen-1.2.7/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_gen-1.2.7/lib/ -source_map_stack_trace -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_map_stack_trace-2.1.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_map_stack_trace-2.1.1/lib/ -source_maps -2.18 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_maps-0.10.12/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_maps-0.10.12/lib/ source_span 2.18 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_span-1.10.0/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/source_span-1.10.0/lib/ stack_trace 2.18 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/lib/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stack_trace-1.11.1/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stack_trace-1.11.1/lib/ stream_channel -2.14 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stream_channel-2.1.1/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stream_channel-2.1.1/lib/ +2.19 +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stream_channel-2.1.2/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/stream_channel-2.1.2/lib/ string_scanner 2.18 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/ @@ -210,18 +150,10 @@ term_glyph 2.12 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/lib/ -test -2.18 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test-1.24.3/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test-1.24.3/lib/ test_api -2.18 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_api-0.6.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_api-0.6.0/lib/ -test_core -2.18 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_core-0.5.3/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_core-0.5.3/lib/ +3.0 +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_api-0.6.1/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/ typed_data 2.12 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/typed_data-1.3.1/ @@ -230,48 +162,36 @@ vector_math 2.14 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/vector_math-2.1.4/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/ -vm_service -2.15 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/vm_service-9.4.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/vm_service-9.4.0/lib/ watcher 2.14 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/watcher-1.0.2/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/watcher-1.0.2/lib/ web -3.1 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web-0.1.4-beta/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web-0.1.4-beta/lib/ -web_socket_channel -2.15 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web_socket_channel-2.4.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web_socket_channel-2.4.0/lib/ -webkit_inspection_protocol -2.12 -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/webkit_inspection_protocol-1.2.0/ -file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/webkit_inspection_protocol-1.2.0/lib/ +3.2 +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web-0.3.0/ +file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/web-0.3.0/lib/ yaml 2.12 file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/yaml-3.1.1/ file:///Users/rafaelsetragni/.pub-cache/hosted/pub.dev/yaml-3.1.1/lib/ sky_engine -3.0 +3.2 file:///Users/rafaelsetragni/Development/flutter/bin/cache/pkg/sky_engine/ file:///Users/rafaelsetragni/Development/flutter/bin/cache/pkg/sky_engine/lib/ flutter -3.0 +3.2 file:///Users/rafaelsetragni/Development/flutter/packages/flutter/ file:///Users/rafaelsetragni/Development/flutter/packages/flutter/lib/ flutter_test -3.0 +3.2 file:///Users/rafaelsetragni/Development/flutter/packages/flutter_test/ file:///Users/rafaelsetragni/Development/flutter/packages/flutter_test/lib/ flutter_web_plugins -3.0 +3.2 file:///Users/rafaelsetragni/Development/flutter/packages/flutter_web_plugins/ file:///Users/rafaelsetragni/Development/flutter/packages/flutter_web_plugins/lib/ awesome_notifications 2.19 -file:///Users/rafaelsetragni/Documents/GitHub/plugins/awesome_notifications/ -file:///Users/rafaelsetragni/Documents/GitHub/plugins/awesome_notifications/lib/ +file:///Users/rafaelsetragni/GitHub/plugins/awesome_notifications/ +file:///Users/rafaelsetragni/GitHub/plugins/awesome_notifications/lib/ 2 diff --git a/.dart_tool/version b/.dart_tool/version index 3523e81f..7ccd8d44 100644 --- a/.dart_tool/version +++ b/.dart_tool/version @@ -1 +1 @@ -3.13.5 \ No newline at end of file +3.16.0 \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5886b489..e1203a6c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,5 +1,10 @@ + + + + + @@ -10,15 +15,18 @@ - - - + + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b05901d..286edc3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [0.8.3] +### Added +* New media player features (Playback state, speed and duration) for media player notifications +### Improved +* Support for Flutter 3.16.0 and the new methods exclusive for Main targets on iOS +* Dependencies updated +* Unit tests updated +* Documentation updated + ## [0.8.2] ### Improved * iOS awesome_notifications library updated to version 0.8.1 diff --git a/README.md b/README.md index ba7a5130..221b9fd3 100644 --- a/README.md +++ b/README.md @@ -1160,9 +1160,9 @@ In summary, if you need to ensure precise execution of scheduled notifications, Additionally, you can ask your users to whitelist your app from any battery optimization feature that the device may have. This can be done by adding your app to the "unmonitored apps" or "battery optimization exceptions" list, depending on the device. -You can also try to use the [flutter_background_fetch](https://pub.dev/packages/flutter_background_fetch) package to help schedule background tasks. This package allows you to schedule tasks that will run even when the app is not open, and it has some built-in features to help handle battery optimization. +You can also try to use the [flutter_background_service](https://pub.dev/packages/flutter_background_service) package to help schedule background tasks. This package allows you to schedule tasks that will run even when the app is not open, and it has some built-in features to help handle battery optimization. -To know more about it, please visit [flutter_background_fetch documentation](https://pub.dev/packages/flutter_background_fetch) and [Optimizing for Doze and App Standby](https://developer.android.com/training/monitoring-device-state/doze-standby) for Android devices. +To know more about it, please visit [flutter_background_service_fetch documentation](https://pub.dev/packages/flutter_background_service) and [Optimizing for Doze and App Standby](https://developer.android.com/training/monitoring-device-state/doze-standby) for Android devices.
@@ -1553,34 +1553,37 @@ NotificationContent ( ) ``` -| Attribute | Required | Description | Type | Value Limits | Default value | -| --------------------- | -------- | -------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------- | ------------- | -| id | YES | A unique identifier for the notification | int | 1 - 2,147,483,647 | - | -| channelKey | YES | The identifier of the notification channel where the notification will be displayed | String | Channel must be enabled | basic_channel | -| title | NO | The title of the notification | String | Unlimited | - | -| body | NO | The body text of the notification | String | Unlimited | - | -| summary | NO | A summary to be displayed when the notification content is protected by privacy | String | Unlimited | - | -| category | NO | The notification category that best describes the nature of the notification (Android only) | NotificationCategory | - | - | -| badge | NO | The value to display as the app's badge | int | 0 - 999,999 | - | -| chronometer | NO | A duration to set the showWhen attribute of Android notifications to the amount of seconds to start | Duration | Positive integers | - | -| timeoutAfter | NO | A duration to determine an expiration time limit for the notification to stay in the system tray | Duration | Positive integers | - | -| showWhen | NO | Whether to show the time elapsed since the notification was posted | bool | True or false | true | -| chronometer | NO | Display how many seconds has | bool | True or false | true | -| displayOnForeground | NO | Whether to display the notification while the app is in the foreground (preserves streams) | bool | True or false | true | -| displayOnBackground | NO | Whether to display the notification while the app is in the background (preserves streams, Android only) | bool | True or false | true | -| icon | NO | The name of the small icon to display with the notification (Android only) | String | A resource image | - | -| largeIcon | NO | The name of the large icon to display with the notification | String | Unlimited | - | -| bigPicture | NO | The name of the image to display when the notification is expanded (Android only) | String | Unlimited | - | -| autoDismissible | NO | Whether to automatically dismiss the notification when the user taps it (Android only) | bool | True or false | true | -| color | NO | The text color for the notification | Color | 0x000000 to 0xFFFFFF | Colors.black | -| backgroundColor | NO | The background color for the notification | Color | 0x000000 to 0xFFFFFF | Colors.white | -| payload | NO | A hidden payload for the notification | Map | Only string values | - | -| notificationLayout | NO | The layout type for the notification | NotificationLayout | - | Default | -| hideLargeIconOnExpand | NO | Whether to hide the large icon when the notification is expanded (Android only) | bool | True or false | false | -| locked | NO | Whether to prevent the user from dismissing the notification (Android only) | bool | True or false | false | -| progress | NO | The current value for the notification's progress bar (Android only) | int | 0 - 100 | - | -| ticker | NO | The text to display in the ticker when the notification arrives | String | Unlimited | - | -| actionType (Only for Android) | NO | Specifies the type of action that should be taken when the user taps on the body of the notification. | Enumerator | NotificationActionType | NotificationActionType.Default | +| Attribute | Required | Description | Type | Value Limits | Default value | +|-------------------------------| -------- |----------------------------------------------------------------------------------------------------------|---------------------------|-------------------------| ------------- | +| id | YES | A unique identifier for the notification | int | 1 - 2,147,483,647 | - | +| channelKey | YES | The identifier of the notification channel where the notification will be displayed | String | Channel must be enabled | basic_channel | +| title | NO | The title of the notification | String | Unlimited | - | +| body | NO | The body text of the notification | String | Unlimited | - | +| summary | NO | A summary to be displayed when the notification content is protected by privacy | String | Unlimited | - | +| category | NO | The notification category that best describes the nature of the notification (Android only) | NotificationCategory | - | - | +| badge | NO | The value to display as the app's badge | int | 0 - 999,999 | - | +| chronometer | NO | A duration to set the showWhen attribute of Android notifications to the amount of seconds to start | Duration | Positive integers | - | +| timeoutAfter | NO | A duration to determine an expiration time limit for the notification to stay in the system tray | Duration | Positive integers | - | +| showWhen | NO | Whether to show the time elapsed since the notification was posted | bool | True or false | true | +| chronometer | NO | Display how many seconds has | bool | True or false | true | +| displayOnForeground | NO | Whether to display the notification while the app is in the foreground (preserves streams) | bool | True or false | true | +| displayOnBackground | NO | Whether to display the notification while the app is in the background (preserves streams, Android only) | bool | True or false | true | +| icon | NO | The name of the small icon to display with the notification (Android only) | String | A resource image | - | +| largeIcon | NO | The name of the large icon to display with the notification | String | Unlimited | - | +| bigPicture | NO | The name of the image to display when the notification is expanded (Android only) | String | Unlimited | - | +| autoDismissible | NO | Whether to automatically dismiss the notification when the user taps it (Android only) | bool | True or false | true | +| color | NO | The text color for the notification | Color | 0x000000 to 0xFFFFFF | Colors.black | +| backgroundColor | NO | The background color for the notification | Color | 0x000000 to 0xFFFFFF | Colors.white | +| payload | NO | A hidden payload for the notification | Map | Only string values | - | +| notificationLayout | NO | The layout type for the notification | NotificationLayout | - | Default | +| hideLargeIconOnExpand | NO | Whether to hide the large icon when the notification is expanded (Android only) | bool | True or false | false | +| locked | NO | Whether to prevent the user from dismissing the notification (Android only) | bool | True or false | false | +| progress | NO | The current value for the notification's progress bar (Android only) | int | 0 - 100 | - | +| ticker | NO | The text to display in the ticker when the notification arrives | String | Unlimited | - | +| duration | NO | The media duration on media player notifications | Duration | Unlimited | - | +| playState | NO | The current playback state on media player notifications | NotificationPlaybackState | - | - | +| playbackSpeed | NO | The current playback speed on media player notifications | double | Unlimited | - | +| actionType (Only for Android) | NO | Specifies the type of action that should be taken when the user taps on the body of the notification. | Enumerator | NotificationActionType | NotificationActionType.Default |
diff --git a/android/build.gradle b/android/build.gradle index 48a8449c..4fe86d43 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'me.carda.awesome_notifications' -version '0.8.0' +version '0.8.1' buildscript { repositories { @@ -43,9 +43,9 @@ android { dependencies { // implementation project(':awn_core') - implementation 'me.carda:AndroidAwnCore:[0.8.0, 0.9.0)' + implementation 'me.carda:AndroidAwnCore:[0.8.2, 0.9.0)' - implementation 'com.google.guava:guava:31.1-android' + implementation 'com.google.guava:guava:32.1.3-android' // Required for instrumented tests testImplementation 'junit:junit:4.13.2' @@ -53,7 +53,7 @@ dependencies { testImplementation 'org.mockito:mockito-core:5.1.1' testImplementation 'org.mockito:mockito-inline:5.0.0' - androidTestImplementation 'androidx.annotation:annotation:1.7.0' + androidTestImplementation 'androidx.annotation:annotation:1.7.1' androidTestImplementation 'org.mockito:mockito-core:5.1.1' androidTestImplementation 'org.mockito:mockito-inline:5.0.0' androidTestImplementation 'androidx.test.ext:junit:1.1.5' diff --git a/coverage/lcov.info b/coverage/lcov.info index 9c14f10b..ffc9a57b 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -272,6 +272,21 @@ DA:49,2 LF:12 LH:12 end_of_record +SF:lib/src/enumerators/notification_play_state.dart +DA:52,3 +DA:53,4 +DA:55,2 +DA:58,2 +DA:59,2 +DA:60,2 +DA:61,6 +DA:62,1 +DA:65,2 +DA:66,10 +DA:68,4 +LF:11 +LH:11 +end_of_record SF:lib/awesome_notifications.dart DA:67,4 DA:68,2 @@ -627,8 +642,6 @@ LF:17 LH:17 end_of_record SF:lib/src/models/notification_content.dart -DA:24,1 -DA:25,1 DA:28,1 DA:29,1 DA:32,1 @@ -643,37 +656,53 @@ DA:48,1 DA:49,1 DA:52,1 DA:53,1 -DA:56,6 -DA:97,6 -DA:123,3 -DA:125,3 -DA:126,6 +DA:56,1 +DA:57,1 +DA:60,1 +DA:61,1 +DA:64,1 +DA:65,1 +DA:68,1 +DA:69,1 +DA:72,6 +DA:120,3 +DA:122,3 +DA:123,6 +DA:126,3 +DA:127,3 +DA:128,6 DA:129,3 DA:130,3 -DA:131,6 +DA:131,3 DA:132,3 DA:133,3 DA:134,3 DA:135,3 -DA:137,6 -DA:140,6 -DA:143,6 -DA:147,3 -DA:155,3 -DA:157,3 -DA:160,6 +DA:136,6 +DA:138,3 +DA:139,3 +DA:141,6 +DA:144,6 +DA:147,6 +DA:151,3 +DA:159,3 DA:161,3 -DA:162,3 -DA:163,3 -DA:164,3 +DA:164,6 DA:165,3 -DA:166,6 +DA:166,3 DA:167,3 DA:168,3 -DA:173,1 +DA:169,3 +DA:170,6 +DA:171,3 +DA:172,3 +DA:173,3 +DA:174,3 DA:175,3 -LF:45 -LH:45 +DA:180,1 +DA:182,3 +LF:59 +LH:59 end_of_record SF:lib/src/models/notification_model.dart DA:25,6 @@ -800,8 +829,8 @@ LF:15 LH:15 end_of_record SF:lib/src/definitions.dart -DA:287,54 -DA:288,18 +DA:290,54 +DA:291,18 LF:2 LH:2 end_of_record @@ -1173,8 +1202,8 @@ DA:119,13 DA:120,10 DA:121,10 DA:124,13 -DA:125,1 -DA:126,1 +DA:125,6 +DA:126,4 DA:129,13 DA:130,9 DA:131,9 @@ -1186,9 +1215,9 @@ DA:138,2 DA:141,8 DA:142,2 DA:147,13 -DA:150,3 -DA:151,2 -DA:152,2 +DA:150,4 +DA:151,4 +DA:152,4 DA:154,13 DA:156,9 DA:157,7 @@ -1203,26 +1232,27 @@ DA:180,9 DA:182,9 DA:183,9 DA:185,9 -DA:187,9 DA:189,9 -DA:195,9 -DA:196,9 +DA:191,9 +DA:193,9 DA:199,9 -DA:201,18 -DA:202,27 +DA:200,9 DA:203,9 -DA:208,18 -DA:209,36 -DA:210,18 -DA:214,1 -DA:216,1 +DA:205,18 +DA:206,27 +DA:207,9 +DA:212,18 +DA:213,36 +DA:214,18 DA:218,1 -DA:219,1 -DA:221,1 -DA:222,2 -DA:223,3 -LF:103 -LH:103 +DA:220,1 +DA:222,1 +DA:223,1 +DA:225,1 +DA:226,2 +DA:227,3 +LF:104 +LH:104 end_of_record SF:lib/src/utils/bitmap_utils.dart DA:9,10 diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index a06fdc85..8a329e67 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - awesome_notifications (0.8.0): + - awesome_notifications (0.8.1): - Flutter - IosAwnCore (~> 0.8.0) - device_info_plus (0.0.1): @@ -55,17 +55,17 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/vibration/ios" SPEC CHECKSUMS: - awesome_notifications: 46bcb1072a613878e97f0f67478f82669b9a1623 - device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea + awesome_notifications: db394d2e061e4583ba0f738ddea611e3986cc3fb + device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 IosAwnCore: ed1b2b6d84962a758354dbacd9ce525c72ce28a9 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 - url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 + url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241 PODFILE CHECKSUM: 75def7c0fdb0efe5a8b7599c2e7d9302906d572f -COCOAPODS: 1.13.0 +COCOAPODS: 1.14.3 diff --git a/example/pubspec.lock b/example/pubspec.lock index a1efae6e..7c14f462 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -31,7 +31,7 @@ packages: path: ".." relative: true source: path - version: "0.7.6" + version: "0.8.3" boolean_selector: dependency: transitive description: @@ -76,10 +76,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -108,10 +108,10 @@ packages: dependency: "direct main" description: name: device_info_plus - sha256: "86add5ef97215562d2e090535b0a16f197902b10c369c558a100e74ea06e8659" + sha256: "0042cb3b2a76413ea5f8a2b40cec2a33e01d0c937e91f0f7c211fde4f7739ba6" url: "https://pub.dev" source: hosted - version: "9.0.3" + version: "9.1.1" device_info_plus_platform_interface: dependency: transitive description: @@ -169,10 +169,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "3.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -187,18 +187,18 @@ packages: dependency: "direct main" description: name: fluttertoast - sha256: "474f7d506230897a3cd28c965ec21c5328ae5605fc9c400cd330e9e9d6ac175c" + sha256: dfdde255317af381bfc1c486ed968d5a43a2ded9c931e87cbecd88767d6a71c1 url: "https://pub.dev" source: hosted - version: "8.2.2" + version: "8.2.4" font_awesome_flutter: dependency: "direct main" description: name: font_awesome_flutter - sha256: "5fb789145cae1f4c3245c58b3f8fb287d055c26323879eab57a7bf0cfd1e45f3" + sha256: "52671aea66da73b58d42ec6d0912b727a42248dd9a7c76d6c20f275783c48c08" url: "https://pub.dev" source: hosted - version: "10.5.0" + version: "10.6.0" giff_dialog: dependency: "direct main" description: @@ -211,10 +211,10 @@ packages: dependency: "direct main" description: name: http - sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.2" http_parser: dependency: transitive description: @@ -243,10 +243,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.19.0" js: dependency: transitive description: @@ -267,10 +267,10 @@ packages: dependency: transitive description: name: lints - sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.0.0" matcher: dependency: transitive description: @@ -291,10 +291,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" numberpicker: dependency: "direct main" description: @@ -387,10 +387,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.7" pointycastle: dependency: transitive description: @@ -411,10 +411,10 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" shared_preferences_android: dependency: transitive description: @@ -480,18 +480,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -512,10 +512,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" typed_data: dependency: transitive description: @@ -536,66 +536,66 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27" + sha256: e9aa5ea75c84cf46b3db4eea212523591211c3cf2e13099ee4ec147f54201c86 url: "https://pub.dev" source: hosted - version: "6.1.14" + version: "6.2.2" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "22f8db4a72be26e9e3a4aa3f194b1f7afbc76d20ec141f84be1d787db2155cbd" + sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def" url: "https://pub.dev" source: hosted - version: "6.0.31" + version: "6.2.0" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "6.2.1" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5" + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.1.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" + sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.2.0" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "81fe91b6c4f84f222d186a9d23c73157dc4c8e1c71489c4d08be1ad3b228f1aa" + sha256: "7286aec002c8feecc338cc33269e96b73955ab227456e9fb2a91f7fab8a358e9" url: "https://pub.dev" source: hosted - version: "2.0.16" + version: "2.2.2" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "254708f17f7c20a9c8c471f67d86d76d4a3f9c1591aad1e15292008aceb82771" + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.1.1" vector_math: dependency: transitive description: @@ -608,18 +608,18 @@ packages: dependency: "direct main" description: name: vibration - sha256: ab6d26f6694ae0cf702b6d3d1b399570f2911eddb1132c8f82eeacb71a08ece2 + sha256: "778ace40e84852e6cf6017cdbaf6790a837d73ff3dd50b27da9ac232a19de8fc" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.4" web: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" win32: dependency: transitive description: @@ -661,5 +661,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index a4f11507..ed30f238 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -31,17 +31,17 @@ dependencies: cupertino_icons: ^1.0.6 universal_io: ^2.2.2 - font_awesome_flutter: ^10.5.0 - fluttertoast: ^8.2.2 - http: ^1.1.0 + font_awesome_flutter: ^10.6.0 + fluttertoast: ^8.2.4 + http: ^1.1.2 path_provider: ^2.1.1 - shared_preferences: ^2.2.1 + shared_preferences: ^2.2.2 numberpicker: ^2.1.2 giff_dialog: ^1.0.1 - vibration: ^1.8.2 - device_info_plus: ^9.0.3 - url_launcher: ^6.1.14 - intl: ^0.18.1 + vibration: ^1.8.4 + device_info_plus: ^9.1.1 + url_launcher: ^6.2.2 + intl: ^0.19.0 palette_generator: ^0.3.3+3 dev_dependencies: @@ -53,7 +53,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.3 + flutter_lints: ^3.0.1 flutter_launcher_icons: ^0.13.1 diff --git a/ios/Classes/lib/SwiftAwesomeNotificationsPlugin.swift b/ios/Classes/lib/SwiftAwesomeNotificationsPlugin.swift index d9196499..9eee4234 100644 --- a/ios/Classes/lib/SwiftAwesomeNotificationsPlugin.swift +++ b/ios/Classes/lib/SwiftAwesomeNotificationsPlugin.swift @@ -1,18 +1,25 @@ - -#if !ACTION_EXTENSION import UIKit import Flutter import UserNotifications import IosAwnCore -public class SwiftAwesomeNotificationsPlugin: +protocol AttachablePlugin { + func attachPlugin(with registrar: FlutterPluginRegistrar) +} + +public class BaseAwesomeNotificationsPlugin: NSObject, FlutterPlugin, + AttachablePlugin, AwesomeEventListener, UNUserNotificationCenterDelegate { static let TAG = "AwesomeNotificationsPlugin" + func attachPlugin(with registrar: FlutterPluginRegistrar) { + fatalError("Must Override") + } + static var flutterRegistrantCallback: FlutterPluginRegistrantCallback? var awesomeNotifications:AwesomeNotifications? var flutterChannel:FlutterMethodChannel? @@ -26,7 +33,7 @@ public class SwiftAwesomeNotificationsPlugin: name: Definitions.CHANNEL_FLUTTER_PLUGIN, binaryMessenger: registrar.messenger()) - SwiftAwesomeNotificationsPlugin() + BaseAwesomeNotificationsPlugin() .AttachAwesomeNotificationsPlugin( usingRegistrar: registrar, throughFlutterChannel: flutterChannel) @@ -57,21 +64,21 @@ public class SwiftAwesomeNotificationsPlugin: registrar.addMethodCallDelegate(self, channel: self.flutterChannel!) registrar.addApplicationDelegate(self) - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "Awesome Notifications plugin attached to iOS \(floor(NSFoundationVersionNumber))") - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "Awesome Notifications - App Group : \(Definitions.USER_DEFAULT_TAG)") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "Awesome Notifications plugin attached to iOS \(floor(NSFoundationVersionNumber))") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "Awesome Notifications - App Group : \(Definitions.USER_DEFAULT_TAG)") if !Definitions.USER_DEFAULT_TAG.starts(with: "group.") { throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INITIALIZATION_EXCEPTION, message: "Your App Group name \"\(Definitions.USER_DEFAULT_TAG)\" is invalid. It must starts with \"group.\"", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".customAppGroup") } } catch { - Logger.shared.e(SwiftAwesomeNotificationsPlugin.TAG, error.localizedDescription) + Logger.shared.e(BaseAwesomeNotificationsPlugin.TAG, error.localizedDescription) } } @@ -85,7 +92,7 @@ public class SwiftAwesomeNotificationsPlugin: awesomeNotifications = nil if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "Awesome Notifications plugin detached from iOS \(floor(NSFoundationVersionNumber))") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "Awesome Notifications plugin detached from iOS \(floor(NSFoundationVersionNumber))") } } @@ -107,7 +114,7 @@ public class SwiftAwesomeNotificationsPlugin: = ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INITIALIZATION_EXCEPTION, message: "Awesome notifications is currently not available", detailedCode: ExceptionCode.DETAILED_INITIALIZATION_FAILED+".awesomeNotifications.core") @@ -273,7 +280,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_MISSING_METHOD, message: "method \(call.method) not found", detailedCode: ExceptionCode.DETAILED_MISSING_METHOD+"."+call.method) @@ -292,7 +299,7 @@ public class SwiftAwesomeNotificationsPlugin: ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_UNKNOWN_EXCEPTION, detailedCode: ExceptionCode.DETAILED_UNEXPECTED_ERROR, originalException: error) @@ -329,7 +336,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Channel data is invalid", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".channel.data") @@ -339,7 +346,7 @@ public class SwiftAwesomeNotificationsPlugin: .setChannel(channel: channel) ?? false if AwesomeNotifications.debug { - Logger.shared.e(SwiftAwesomeNotificationsPlugin.TAG, "Channel \(updated ? "" : "wasn't ")updated") + Logger.shared.e(BaseAwesomeNotificationsPlugin.TAG, "Channel \(updated ? "" : "wasn't ")updated") } result(updated) @@ -352,7 +359,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Empty channel key", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".channel.key") @@ -362,13 +369,13 @@ public class SwiftAwesomeNotificationsPlugin: .removeChannel(channelKey: channelKey) ?? false { if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "Channel removed") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "Channel removed") } result(true) } else { if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "Channel '\(channelKey)' not found") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "Channel '\(channelKey)' not found") } result(false) } @@ -397,7 +404,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid Badge value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".badge.value") @@ -448,7 +455,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid id value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.id") @@ -459,7 +466,7 @@ public class SwiftAwesomeNotificationsPlugin: .dismissNotification(byId: notificationId!) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, dismissed ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, dismissed ? "Notification \(notificationId!) dismissed": "Notification \(notificationId!) was not found") } @@ -473,7 +480,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid id value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.id") @@ -484,7 +491,7 @@ public class SwiftAwesomeNotificationsPlugin: .cancelSchedule(byId: notificationId!) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, cancelled ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, cancelled ? "Schedule \(notificationId!) cancelled": "Schedule \(notificationId!) was not found") } @@ -498,7 +505,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid id value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.id") @@ -509,7 +516,7 @@ public class SwiftAwesomeNotificationsPlugin: .cancelNotification(byId: notificationId!) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, cancelled ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, cancelled ? "Notification \(notificationId!) cancelled": "Notification \(notificationId!) was not found") } @@ -522,7 +529,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid channel key value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.channelKey") @@ -533,7 +540,7 @@ public class SwiftAwesomeNotificationsPlugin: .dismissNotifications(byChannelKey: channelKey) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, success ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, success ? "Notifications from channel \(channelKey) dismissed": "Notifications from channel \(channelKey) not found") } @@ -546,7 +553,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid channel key value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.channelKey") @@ -557,7 +564,7 @@ public class SwiftAwesomeNotificationsPlugin: .cancelSchedules(byChannelKey: channelKey) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, success ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, success ? "Scheduled notifications from channel \(channelKey) canceled": "Scheduled notifications from channel \(channelKey) not found") } @@ -570,7 +577,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid channel key value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.channelKey") @@ -581,7 +588,7 @@ public class SwiftAwesomeNotificationsPlugin: .cancelNotifications(byChannelKey: channelKey) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, success ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, success ? "Notifications and schedules from channel \(channelKey) canceled": "Notifications and schedules from channel \(channelKey) not found") } @@ -594,7 +601,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid group key value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.groupKey") @@ -605,7 +612,7 @@ public class SwiftAwesomeNotificationsPlugin: .dismissNotifications(byGroupKey: groupKey) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, success ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, success ? "Notifications from group \(groupKey) dismissed": "Notifications from group \(groupKey) not found") } @@ -618,7 +625,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid group key value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.groupKey") @@ -629,7 +636,7 @@ public class SwiftAwesomeNotificationsPlugin: .cancelSchedules(byGroupKey: groupKey) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, success ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, success ? "Scheduled notifications from group \(groupKey) cancelled": "Scheduled notifications from group \(groupKey) not found") } @@ -642,7 +649,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Invalid group key value", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".dismiss.groupKey") @@ -653,7 +660,7 @@ public class SwiftAwesomeNotificationsPlugin: .cancelNotifications(byGroupKey: groupKey) ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, success ? + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, success ? "Notifications and schedules from group \(groupKey) cancelled": "Notifications and schedules from group \(groupKey) not found") } @@ -667,7 +674,7 @@ public class SwiftAwesomeNotificationsPlugin: .dismissAllNotifications() ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "All notifications was dismissed") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "All notifications was dismissed") } result(success) @@ -679,7 +686,7 @@ public class SwiftAwesomeNotificationsPlugin: .cancelAllSchedules() ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "All schedules was cancelled") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "All schedules was cancelled") } result(success) @@ -691,7 +698,7 @@ public class SwiftAwesomeNotificationsPlugin: .cancelAllNotifications() ?? false if AwesomeNotifications.debug { - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "All notifications was cancelled") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "All notifications was cancelled") } result(success) @@ -798,7 +805,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_MISSING_ARGUMENTS, message: "Arguments are missing", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS) @@ -809,7 +816,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Permission list is required", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".permissionList") @@ -819,7 +826,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Permission list is required", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".permissionList") @@ -840,7 +847,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_MISSING_ARGUMENTS, message: "Arguments are missing", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS) @@ -851,7 +858,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Permission list is required", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".permissionList") @@ -861,7 +868,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Permission list is required", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".permissionList") @@ -882,7 +889,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_MISSING_ARGUMENTS, message: "Arguments are missing", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS) @@ -893,7 +900,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Permission list is required", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".permissionList") @@ -903,7 +910,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Permission list is required", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".permissionList") @@ -925,7 +932,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Notification content is invalid", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".notificationModel.data") @@ -949,7 +956,7 @@ public class SwiftAwesomeNotificationsPlugin: let awesomeException = ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Notification content is invalid", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS+".notificationModel.data") @@ -977,7 +984,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_MISSING_ARGUMENTS, message: "Arguments are missing", detailedCode: ExceptionCode.DETAILED_REQUIRED_ARGUMENTS) @@ -996,7 +1003,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Notification channel `\(channelsData)` is invalid", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".channel.invalid.\(channelsData)") @@ -1007,7 +1014,7 @@ public class SwiftAwesomeNotificationsPlugin: throw ExceptionFactory .shared .createNewAwesomeException( - className: SwiftAwesomeNotificationsPlugin.TAG, + className: BaseAwesomeNotificationsPlugin.TAG, code: ExceptionCode.CODE_INVALID_ARGUMENTS, message: "Notification channel `\(channelsData)` is invalid", detailedCode: ExceptionCode.DETAILED_INVALID_ARGUMENTS+".channel.invalid.\(channelsData)") @@ -1023,7 +1030,7 @@ public class SwiftAwesomeNotificationsPlugin: backgroundHandle: dartBgHandle, debug: debug) - Logger.shared.d(SwiftAwesomeNotificationsPlugin.TAG, "Awesome Notifications service initialized") + Logger.shared.d(BaseAwesomeNotificationsPlugin.TAG, "Awesome Notifications service initialized") result(awesomeNotifications != nil) } @@ -1045,10 +1052,23 @@ public class SwiftAwesomeNotificationsPlugin: let success = actionHandle != 0 if !success { - Logger.shared.e(SwiftAwesomeNotificationsPlugin.TAG, "Attention: there is no valid static method to receive notification action data in background") + Logger.shared.e(BaseAwesomeNotificationsPlugin.TAG, "Attention: there is no valid static method to receive notification action data in background") } result(success) } } -#endif + +public class SwiftAwesomeNotificationsPlugin: BaseAwesomeNotificationsPlugin { + public override func attachPlugin(with registrar: FlutterPluginRegistrar) { + registrar.addMethodCallDelegate(self, channel: self.flutterChannel!) + } +} + +@available(iOSApplicationExtension, unavailable) +public class ExtensionAwesomeNotificationsPlugin: BaseAwesomeNotificationsPlugin { + public override func attachPlugin(with registrar: FlutterPluginRegistrar) { + registrar.addMethodCallDelegate(self, channel: self.flutterChannel!) + registrar.addApplicationDelegate(self) + } +} diff --git a/lib/src/definitions.dart b/lib/src/definitions.dart index 07b9a6b8..988620e1 100644 --- a/lib/src/definitions.dart +++ b/lib/src/definitions.dart @@ -328,35 +328,3 @@ class Definitions { NOTIFICATION_ROUNDED_BIG_PICTURE: false, }; } - -/* - State of PlaybackStateCompat - https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat - */ -/// This is the default playback state and indicates that no media has been added yet, or the performer has been reset and has no content to play. -const PLAY_STATE_NONE = 0; -/// State indicating this item is currently stopped. -const PLAY_STATE_STOPPED = 1; -/// State indicating this item is currently paused. -const PLAY_STATE_PAUSED = 2; -/// State indicating this item is currently playing. -const PLAY_STATE_PLAYING = 3; -/// State indicating this item is currently fast forwarding. -const PLAY_STATE_FAST_FORWARDING = 4; -/// State indicating this item is currently rewinding. -const PLAY_STATE_REWINDING = 5; -/// State indicating this item is currently buffering and will begin playing when enough data has buffered. -const PLAY_STATE_BUFFERING = 6; -/// State indicating this item is currently in an error state. The error code should also be set when entering this state. -const PLAY_STATE_ERROR = 7; -/// State indicating the class doing playback is currently connecting to a route. Depending on the implementation you may return to the previous state when the connection finishes or enter STATE_NONE. If the connection failed STATE_ERROR should be used. -/// On devices earlier than API 21, this will appear as STATE_BUFFERING -const PLAY_STATE_CONNECTING = 8; -/// State indicating the player is currently skipping to the previous item. -const PLAY_STATE_SKIPPING_TO_PREVIOUS = 9; -/// State indicating the player is currently skipping to the next item. -const PLAY_STATE_SKIPPING_TO_NEXT = 10; -/// State indicating the player is currently skipping to a specific item in the queue. -const PLAY_STATE_SKIPPING_TO_QUEUE_ITEM = 11; -/// Use this value for the position to indicate the position is not known. -const PLAY_PLAYBACK_POSITION_UNKNOWN = -1; diff --git a/lib/src/enumerators/notification_play_state.dart b/lib/src/enumerators/notification_play_state.dart new file mode 100644 index 00000000..52132daf --- /dev/null +++ b/lib/src/enumerators/notification_play_state.dart @@ -0,0 +1,72 @@ +/* + State of PlaybackStateCompat + https://developer.android.com/reference/kotlin/android/support/v4/media/session/PlaybackStateCompat + */ + +/// Notification Layout to be used as reference to build the notification. +/// If is not possible to build the desired layout, use the default one. +/// +/// [none] This is the default playback state and indicates that no media has been added yet, or the performer has been reset and has no content to play. +/// [stopped] State indicating this item is currently stopped. +/// [paused] State indicating this item is currently paused. +/// [playing] State indicating this item is currently playing. +/// [forwarding] State indicating this item is currently fast forwarding. +/// [rewinding] State indicating this item is currently rewinding. +/// [buffering] State indicating this item is currently buffering and will begin playing when enough data has buffered. +/// [error] State indicating this item is currently in an error state. The error code should also be set when entering this state. +/// [connecting] On devices earlier than API 21, this will appear as STATE_BUFFERING +/// [previous] State indicating the player is currently skipping to the previous item. +/// [next] State indicating the player is currently skipping to the next item. +/// [skippingToQueueItem] State indicating the player is currently skipping to a specific item in the queue. +/// [unknown] Use this value for the position to indicate the position is not known. +enum NotificationPlayState { + + /// Use this value for the position to indicate the position is not known. + unknown, + /// This is the default playback state and indicates that no media has been added yet, or the performer has been reset and has no content to play. + none, + /// State indicating this item is currently stopped. + stopped, + /// State indicating this item is currently paused. + paused, + /// State indicating this item is currently playing. + playing, + /// State indicating this item is currently fast forwarding. + forwarding, + /// State indicating this item is currently rewinding. + rewinding, + /// State indicating this item is currently buffering and will begin playing when enough data has buffered. + buffering, + /// State indicating this item is currently in an error state. The error code should also be set when entering this state. + error, + /// State indicating the class doing playback is currently connecting to a route. Depending on the implementation you may return to the previous state when the connection finishes or enter STATE_NONE. If the connection failed STATE_ERROR should be used. + /// On devices earlier than API 21, this will appear as STATE_BUFFERING + connecting, + /// State indicating the player is currently skipping to the previous item. + previous, + /// State indicating the player is currently skipping to the next item. + next, + /// State indicating the player is currently skipping to a specific item in the queue. + skippingToQueueItem; + + int toMap() => index -1; + static NotificationPlayState? fromMap(dynamic value) { + if (value == null) return null; + if (value is String){ + return NotificationPlayState + .values + .cast() + .toList() + .firstWhere( + (e) => e?.name == value, + orElse: () => null + ); + } + if (value is int){ + return value >= NotificationPlayState.values.length-1 || value < -1 + ? null + : NotificationPlayState.values[value + 1]; + } + return null; + } +} \ No newline at end of file diff --git a/lib/src/models/notification_content.dart b/lib/src/models/notification_content.dart index b21f9800..552c6f45 100644 --- a/lib/src/models/notification_content.dart +++ b/lib/src/models/notification_content.dart @@ -4,6 +4,7 @@ import '../definitions.dart'; import '../enumerators/action_type.dart'; import '../enumerators/notification_category.dart'; import '../enumerators/notification_layout.dart'; +import '../enumerators/notification_play_state.dart'; import '../utils/assert_utils.dart'; import 'base_notification_content.dart'; @@ -11,7 +12,9 @@ import 'base_notification_content.dart'; /// If notification has no [body] or [title], it will only be created, but not displayed to the user (background notification). class NotificationContent extends BaseNotificationContent { bool? _hideLargeIconOnExpand; - int? _progress, _badge, _duration, _playState; + int? _progress, _badge; + Duration? _duration; + NotificationPlayState? _playState; String? _ticker; double? _playbackSpeed; @@ -54,11 +57,11 @@ class NotificationContent extends BaseNotificationContent { return _locked; } - int? get duration { + Duration? get duration { return _duration; } - int? get playState { + NotificationPlayState? get playState { return _playState; } @@ -67,31 +70,31 @@ class NotificationContent extends BaseNotificationContent { } NotificationContent( - {required int id, - required String channelKey, - String? title, - String? body, - String? groupKey, - String? summary, - String? icon, - String? largeIcon, - String? bigPicture, - String? customSound, - bool showWhen = true, - bool wakeUpScreen = false, - bool fullScreenIntent = false, - bool criticalAlert = false, - bool roundedLargeIcon = false, - bool roundedBigPicture = false, - bool autoDismissible = true, - Color? color, - Duration? timeoutAfter, - Duration? chronometer, - Color? backgroundColor, - ActionType actionType = ActionType.Default, + {required int super.id, + required String super.channelKey, + super.title, + super.body, + super.groupKey, + super.summary, + super.icon, + super.largeIcon, + super.bigPicture, + super.customSound, + super.showWhen, + super.wakeUpScreen, + super.fullScreenIntent, + super.criticalAlert, + super.roundedLargeIcon, + super.roundedBigPicture, + super.autoDismissible, + super.color, + super.timeoutAfter, + super.chronometer, + super.backgroundColor, + super.actionType, NotificationLayout notificationLayout = NotificationLayout.Default, - Map? payload, - NotificationCategory? category, + super.payload, + super.category, bool hideLargeIconOnExpand = false, bool locked = false, int? progress, @@ -99,8 +102,8 @@ class NotificationContent extends BaseNotificationContent { String? ticker, bool displayOnForeground = true, bool displayOnBackground = true, - int? duration, - int? playState, + Duration? duration, + NotificationPlayState? playState, double? playbackSpeed}) : _hideLargeIconOnExpand = hideLargeIconOnExpand, _progress = progress, @@ -112,32 +115,7 @@ class NotificationContent extends BaseNotificationContent { _locked = locked, _duration = duration, _playState = playState, - _playbackSpeed = playbackSpeed, - super( - id: id, - channelKey: channelKey, - groupKey: groupKey, - title: title, - body: body, - summary: summary, - wakeUpScreen: wakeUpScreen, - fullScreenIntent: fullScreenIntent, - category: category, - criticalAlert: criticalAlert, - showWhen: showWhen, - payload: payload, - icon: icon, - timeoutAfter: timeoutAfter, - chronometer: chronometer, - largeIcon: largeIcon, - bigPicture: bigPicture, - customSound: customSound, - autoDismissible: autoDismissible, - color: color, - actionType: actionType, - backgroundColor: backgroundColor, - roundedBigPicture: roundedBigPicture, - roundedLargeIcon: roundedLargeIcon); + _playbackSpeed = playbackSpeed; @override NotificationContent? fromMap(Map mapData) { @@ -153,9 +131,10 @@ class NotificationContent extends BaseNotificationContent { _locked = AwesomeAssertUtils.extractValue(NOTIFICATION_LOCKED, mapData); _duration = - AwesomeAssertUtils.extractValue(NOTIFICATION_DURATION, mapData); + AwesomeAssertUtils.extractValue(NOTIFICATION_DURATION, mapData); _playState = - AwesomeAssertUtils.extractValue(NOTIFICATION_PLAY_STATE, mapData); + NotificationPlayState.fromMap(mapData[NOTIFICATION_PLAY_STATE]); + _playbackSpeed = AwesomeAssertUtils.extractValue(NOTIFICATION_PLAYBACK_SPEED, mapData); @@ -191,8 +170,8 @@ class NotificationContent extends BaseNotificationContent { NOTIFICATION_LAYOUT: _notificationLayout?.name, NOTIFICATION_DISPLAY_ON_FOREGROUND: _displayOnForeground, NOTIFICATION_DISPLAY_ON_BACKGROUND: _displayOnBackground, - NOTIFICATION_DURATION: _duration, - NOTIFICATION_PLAY_STATE: _playState, + NOTIFICATION_DURATION: _duration?.inSeconds, + NOTIFICATION_PLAY_STATE: _playState?.toMap(), NOTIFICATION_PLAYBACK_SPEED: _playbackSpeed, }); return dataMap; diff --git a/lib/src/utils/assert_utils.dart b/lib/src/utils/assert_utils.dart index d34bb49d..9f6c0e95 100644 --- a/lib/src/utils/assert_utils.dart +++ b/lib/src/utils/assert_utils.dart @@ -122,7 +122,7 @@ class AwesomeAssertUtils { return defaultValue; case double: - if (value is int) return value; + if (value is int) return value.toDouble(); if (value is double) return value; return defaultValue; @@ -184,6 +184,10 @@ class AwesomeAssertUtils { if (value is T) return value; + if (value == null) return defaultValue; + + if (value is int) return defaultValue; + if (value == null || value is! String) return defaultValue; if (AwesomeStringUtils.isNullOrEmpty(value, diff --git a/pubspec.lock b/pubspec.lock index e1d01483..c5db3199 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "8880b4cfe7b5b17d57c052a5a3a8cc1d4f546261c7cc8fbd717bd53f48db0568" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a url: "https://pub.dev" source: hosted - version: "59.0.0" + version: "61.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: a89627f49b0e70e068130a36571409726b04dab12da7e5625941d2c8ec278b96 + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 url: "https://pub.dev" source: hosted - version: "5.11.1" + version: "5.13.0" args: dependency: transitive description: @@ -93,10 +93,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -105,14 +105,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.1" - coverage: - dependency: transitive - description: - name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" - url: "https://pub.dev" - source: hosted - version: "1.6.3" crypto: dependency: transitive description: @@ -162,10 +154,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "3.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -176,14 +168,6 @@ packages: description: flutter source: sdk version: "0.0.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" - source: hosted - version: "3.2.0" glob: dependency: transitive description: @@ -192,54 +176,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" intl: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.1" - io: - dependency: transitive - description: - name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" - source: hosted - version: "1.0.4" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" + version: "0.19.0" lints: dependency: transitive description: name: lints - sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.0" logging: dependency: transitive description: @@ -268,42 +220,26 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - mime: - dependency: transitive - description: - name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.10.0" mockito: dependency: "direct dev" description: name: mockito - sha256: "7d5b53bcd556c1bc7ffbe4e4d5a19c3e112b7e925e9e172dd7c6ad0630812616" + sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" url: "https://pub.dev" source: hosted - version: "5.4.2" + version: "5.4.4" mocktail: dependency: "direct dev" description: name: mocktail - sha256: "9503969a7c2c78c7292022c70c0289ed6241df7a9ba720010c0b215af29a5a58" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + sha256: f603ebd85a576e5914870b02e5839fc5d0243b867bf710651cf239a28ebb365e url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "1.0.2" package_config: dependency: transitive description: @@ -324,18 +260,10 @@ packages: dependency: "direct main" description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d - url: "https://pub.dev" - source: hosted - version: "2.1.6" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 url: "https://pub.dev" source: hosted - version: "1.5.1" + version: "2.1.7" pub_semver: dependency: transitive description: @@ -344,38 +272,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" - shelf: - dependency: transitive - description: - name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c - url: "https://pub.dev" - source: hosted - version: "1.4.0" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306 - url: "https://pub.dev" - source: hosted - version: "3.0.1" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c - url: "https://pub.dev" - source: hosted - version: "1.1.1" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 - url: "https://pub.dev" - source: hosted - version: "1.0.3" sky_engine: dependency: transitive description: flutter @@ -389,22 +285,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.7" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" - url: "https://pub.dev" - source: hosted - version: "0.10.12" source_span: dependency: transitive description: @@ -417,18 +297,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -445,30 +325,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" - test: - dependency: transitive - description: - name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" - url: "https://pub.dev" - source: hosted - version: "1.24.3" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" - test_core: - dependency: transitive - description: - name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" - url: "https://pub.dev" - source: hosted - version: "0.5.3" + version: "0.6.1" typed_data: dependency: transitive description: @@ -485,14 +349,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 - url: "https://pub.dev" - source: hosted - version: "9.4.0" watcher: dependency: transitive description: @@ -505,26 +361,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "2.4.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" - url: "https://pub.dev" - source: hosted - version: "1.2.0" + version: "0.3.0" yaml: dependency: transitive description: @@ -534,5 +374,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index 5d981f81..8e771186 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: awesome_notifications description: A complete solution to create Local and Push Notifications, customizing buttons, images, sounds, emoticons and applying many different layouts for Flutter apps. -version: 0.8.2 +version: 0.8.3 repository: https://github.com/rafaelsetragni/awesome_notifications environment: @@ -13,16 +13,16 @@ dependencies: flutter_web_plugins: sdk: flutter - plugin_platform_interface: ^2.1.6 - intl: ^0.18.1 + plugin_platform_interface: ^2.1.7 + intl: ^0.19.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.3 + flutter_lints: ^3.0.1 - mockito: ^5.4.2 - mocktail: ^1.0.0 + mockito: ^5.4.3 + mocktail: ^1.0.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/test/src/enumerators/notification_play_state_test.dart b/test/src/enumerators/notification_play_state_test.dart new file mode 100644 index 00000000..aa7a8064 --- /dev/null +++ b/test/src/enumerators/notification_play_state_test.dart @@ -0,0 +1,35 @@ +import 'package:awesome_notifications/src/enumerators/notification_play_state.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('NotificationPlayState Tests', () { + test('toMap method should return correct integer values', () { + expect(NotificationPlayState.unknown.toMap(), -1); + expect(NotificationPlayState.none.toMap(), 0); + expect(NotificationPlayState.stopped.toMap(), 1); + expect(NotificationPlayState.skippingToQueueItem.toMap(), 11); + }); + + test('fromMap method should reconstruct enum from integer values', () { + expect(NotificationPlayState.fromMap(-1), NotificationPlayState.unknown); + expect(NotificationPlayState.fromMap(0), NotificationPlayState.none); + expect(NotificationPlayState.fromMap(1), NotificationPlayState.stopped); + expect(NotificationPlayState.fromMap(11), NotificationPlayState.skippingToQueueItem); + }); + + test('fromMap method should reconstruct enum from string values', () { + expect(NotificationPlayState.fromMap('unknown'), NotificationPlayState.unknown); + expect(NotificationPlayState.fromMap('none'), NotificationPlayState.none); + expect(NotificationPlayState.fromMap('stopped'), NotificationPlayState.stopped); + expect(NotificationPlayState.fromMap('skippingToQueueItem'), NotificationPlayState.skippingToQueueItem); + }); + + test('fromMap method should return null for invalid values', () { + expect(NotificationPlayState.fromMap(null), isNull); + expect(NotificationPlayState.fromMap(''), isNull); + expect(NotificationPlayState.fromMap('invalid_value'), isNull); + expect(NotificationPlayState.fromMap(12), isNull); + expect(NotificationPlayState.fromMap(-2), isNull); + }); + }); +} \ No newline at end of file diff --git a/test/src/models/notification_content_test.dart b/test/src/models/notification_content_test.dart index f6ec9218..ce818963 100644 --- a/test/src/models/notification_content_test.dart +++ b/test/src/models/notification_content_test.dart @@ -1,4 +1,5 @@ import 'package:awesome_notifications/awesome_notifications.dart'; +import 'package:awesome_notifications/src/enumerators/notification_play_state.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { @@ -76,6 +77,46 @@ void main() { }); }); + group('fromMap media player Tests', () { + test('Valid data with integer play state', () { + final Map mapData = { + 'id': 1, + 'channelKey': 'test_channel', + 'duration': 50, + 'playState': 5, + 'playbackSpeed': 2, + }; + + final notificationContent = NotificationContent( + id: 1, + channelKey: 'test_channel', + ).fromMap(mapData); + + expect(notificationContent?.duration, const Duration(seconds: 50)); + expect(notificationContent?.playState, NotificationPlayState.rewinding); + expect(notificationContent?.playbackSpeed, 2); + }); + + test('Valid data with string play state', () { + final Map mapData = { + 'id': 1, + 'channelKey': 'test_channel', + 'duration': 50, + 'playState': 'rewinding', + 'playbackSpeed': 2, + }; + + final notificationContent = NotificationContent( + id: 1, + channelKey: 'test_channel', + ).fromMap(mapData); + + expect(notificationContent?.duration, const Duration(seconds: 50)); + expect(notificationContent?.playState, NotificationPlayState.rewinding); + expect(notificationContent?.playbackSpeed, 2); + }); + }); + group('toMap Tests', () { test('Object is properly serialized', () { final notificationContent = NotificationContent(