From 3da5d54ea05491979404429725086d4c652ab816 Mon Sep 17 00:00:00 2001 From: Basem Osama Date: Wed, 8 Jan 2025 19:36:32 +0200 Subject: [PATCH 01/17] feat: Update package to 1.0.0-beta.1 - CU-86c0xzmxm - Add support for wasm support for web. - Update flutter_secure_storage: to v10.0.0-beta.2 which includes some breaking changes. Signed-off-by: Basem Osama --- CHANGELOG.md | 3 +++ example/pubspec.lock | 34 +++++++++++++--------------------- pubspec.yaml | 4 ++-- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4a19e..c3ee343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.0-beta.1 +- Add support for wasm support for web. +- Update flutter_secure_storage: to v10.0.0-beta.2 which includes some breaking changes. # 0.5.5 - refactor: Update packages. diff --git a/example/pubspec.lock b/example/pubspec.lock index f057f3d..f651361 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -106,50 +106,50 @@ packages: dependency: transitive description: name: flutter_secure_storage - sha256: "1913841ac4c7bf57cd2e05b717e1fbff7841b542962feff827b16525a781b3e4" + sha256: c0f1abb088adddc193286ea91eedd71900ec5707ac86503a7ae09d88c9ffc22b url: "https://pub.dev" source: hosted - version: "9.2.3" + version: "10.0.0-beta.2" flutter_secure_storage_linux: dependency: transitive description: name: flutter_secure_storage_linux - sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 + sha256: b777e220fbf21c149574aa31f9e4ed56dcf025c4ef196664fe90954c265105dc url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "2.0.0" flutter_secure_storage_macos: dependency: transitive description: name: flutter_secure_storage_macos - sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + sha256: "75894eb6b402ac7f7f5ee5487d651b87855a338e26eb6993f4b2fce33013a615" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "4.0.0" flutter_secure_storage_platform_interface: dependency: transitive description: name: flutter_secure_storage_platform_interface - sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.1" flutter_secure_storage_web: dependency: transitive description: name: flutter_secure_storage_web - sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + sha256: "4c3f233e739545c6cb09286eeec1cc4744138372b985113acc904f7263bef517" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "2.0.0" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + sha256: ff32af20f70a8d0e59b2938fc92de35b54a74671041c814275afd80e27df9f21 url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "4.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -168,14 +168,6 @@ packages: url: "https://pub.dev" source: hosted version: "8.0.3" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" leak_tracker: dependency: transitive description: @@ -302,7 +294,7 @@ packages: path: ".." relative: true source: path - version: "0.5.5" + version: "1.0.0-beta.1" plugin_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index aa2fa1f..debc361 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: playx_core description: Core package for playx eco system contains shared classes and utilities. -version: 0.5.5 +version: 1.0.0-beta.1 homepage: https://github.com/playx-flutter/playx_core repository: https://github.com/playx-flutter/playx_core issue_tracker: https://github.com/playx-flutter/playx_core/issues @@ -20,7 +20,7 @@ dependencies: shared_preferences: ^2.3.5 equatable: ^2.0.7 sprintf: ^7.0.0 - flutter_secure_storage: ^9.2.3 + flutter_secure_storage: ^10.0.0-beta.2 flutter_dotenv: ^5.2.1 get_it: ^8.0.3 From d3e5f446537de12a38e710468af4a484f8c5a1ec Mon Sep 17 00:00:00 2001 From: Basem Osama Date: Wed, 8 Jan 2025 19:43:09 +0200 Subject: [PATCH 02/17] feat: Update lints - CU-86c1jfhc3 Signed-off-by: Basem Osama --- lib/src/utils/safe_json_convert.dart | 28 ++++++++++++++-------------- pubspec.yaml | 1 + 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/src/utils/safe_json_convert.dart b/lib/src/utils/safe_json_convert.dart index f8cae42..6dcb5a2 100644 --- a/lib/src/utils/safe_json_convert.dart +++ b/lib/src/utils/safe_json_convert.dart @@ -38,7 +38,7 @@ String? asStringOrNull( return toStringOrNull(json[key]); } -/// Convert any map value with [key] to Map or null safely. +/// Convert any map value with [key] to [Map] or null safely. Map? asMapOrNull( dynamic json, String key, @@ -57,7 +57,7 @@ List? asListOrNull(dynamic json, String key) { return toListOrNull(json[key]); } -/// Convert any map value with [key] to List or null safely. +/// Convert any map value with [key] to [List] or null safely. /// Returns null if any of the values in the list is not an int. List? asListIntOrNull( dynamic json, @@ -78,7 +78,7 @@ List? asListIntOrNull( return value.whereType().toList(); } -/// Convert any map value with [key] to List or null safely. +/// Convert any map value with [key] to [List] or null safely. /// Returns null if any of the values in the list couldn't be converted to String. List? asListStringOrNull( dynamic json, @@ -98,7 +98,7 @@ List? asListStringOrNull( return value.whereType().toList(); } -/// Convert any map value with [key] to List or null safely. +/// Convert any map value with [key] to [List] or null safely. /// Returns null if any of the values in the list couldn't be converted to T. List? asListOrNullT(dynamic json, String key, {required T Function(dynamic json)? fromJson}) { @@ -223,7 +223,7 @@ String asString( ); } -/// Convert any map value with [key] to Map or [fallback] safely. +/// Convert any map value with [key] to [Map] or [fallback] safely. /// Throws a [FormatException] if the conversion fails. Map asMap( dynamic json, @@ -251,7 +251,7 @@ List asList( ); } -/// Convert any map value with [key] to List or [fallback] safely. +/// Convert any map value with [key] to [List] or [fallback] safely. /// Throws a [FormatException] if the conversion fails. List asListT( dynamic json, @@ -265,7 +265,7 @@ List asListT( ); } -/// Convert any map value with [key] to List or [fallback] safely. +/// Convert any map value with [key] to [List] or [fallback] safely. /// Throws a [FormatException] if the conversion fails. List asListFromJson( dynamic json, String key, T Function(dynamic json) fromJson, @@ -279,7 +279,7 @@ List asListFromJson( ); } -/// Convert any map value with [key] to List or [fallback] safely. +/// Convert any map value with [key] to [List] or [fallback] safely. /// Throws a [FormatException] if the conversion fails. List asListInt( dynamic json, @@ -291,7 +291,7 @@ List asListInt( ); } -/// Convert any map value with [key] to List or [fallback] safely. +/// Convert any map value with [key] to [List] or [fallback] safely. /// Throws a [FormatException] if the conversion fails. List asListString( dynamic json, @@ -359,7 +359,7 @@ String asStringOr(dynamic json, String key, {String fallback = ''}) { fallback: fallback); } -/// Convert any map value with [key] to Map or [fallback] safely. +/// Convert any map value with [key] to [Map] or [fallback] safely. /// If [fallback] is not provided, it defaults to an empty map. Map asMapOr(dynamic json, String key, {Map fallback = const {}}) { @@ -382,7 +382,7 @@ List asListOr(dynamic json, String key, {List fallback = const []}) { fallback: fallback); } -/// Convert any map value with [key] to List or [fallback] safely. +/// Convert any map value with [key] to [List] or [fallback] safely. /// If [fallback] is not provided, it defaults to an empty list. List asListTOr(dynamic json, String key, {List fallback = const []}) { return toListTOr( @@ -393,7 +393,7 @@ List asListTOr(dynamic json, String key, {List fallback = const []}) { fallback: fallback); } -/// Convert any map value with [key] to List or [fallback] safely. +/// Convert any map value with [key] to [List] or [fallback] safely. /// If [fallback] is not provided, it defaults to an empty list. List asListFromJsonOr( dynamic json, String key, T Function(dynamic json) fromJson, @@ -407,14 +407,14 @@ List asListFromJsonOr( fallback: fallback); } -/// Convert any map value with [key] to List or [fallback] safely. +/// Convert any map value with [key] to [List] or [fallback] safely. /// If [fallback] is not provided, it defaults to an empty list. List asListIntOr(dynamic json, String key, {List fallback = const []}) { return asListTOr(json, key, fallback: fallback); } -/// Convert any map value with [key] to List or [fallback] safely. +/// Convert any map value with [key] to [List] or [fallback] safely. /// If [fallback] is not provided, it defaults to an empty list. List asListStringOr(dynamic json, String key, {List fallback = const []}) { diff --git a/pubspec.yaml b/pubspec.yaml index debc361..8b0e558 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,3 +28,4 @@ dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^5.0.0 + lints: ^5.1.1 From 2a7ee361c9fea6e352143281adb91da3f111456e Mon Sep 17 00:00:00 2001 From: Basem Osama Date: Wed, 8 Jan 2025 19:45:59 +0200 Subject: [PATCH 03/17] feat: Update min dart sdk to v3.3.0 - CU-86c1jfhc3 Signed-off-by: Basem Osama --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 8b0e558..7fc6ef9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ topics: - env environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.3.0 <4.0.0" dependencies: flutter: From fd5af668e54e0a0e0fe9dd54de8b87bbf8beb0f1 Mon Sep 17 00:00:00 2001 From: Basem Osama Date: Sun, 19 Jan 2025 17:38:01 +0200 Subject: [PATCH 04/17] refactor: Update to v1.0.0-beta.2 - CU-86c1jfhc3 Signed-off-by: Basem Osama --- CHANGELOG.md | 7 +++++++ pubspec.yaml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0478301..8bedd20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +# 1.0.0-beta.2 +> Note: This release has breaking changes. + +- Update flutter_secure_storage: to v10.0.0-beta.4. +- Added v0.6.0 changes. + + # 1.0.0-beta.1 - Add support for wasm support for web. - Update flutter_secure_storage: to v10.0.0-beta.2 which includes some breaking changes. diff --git a/pubspec.yaml b/pubspec.yaml index 9243eb9..d06093a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: playx_core description: Core package for playx eco system contains shared classes and utilities. -version: 1.0.0-beta.1 +version: 1.0.0-beta.2 homepage: https://github.com/playx-flutter/playx_core repository: https://github.com/playx-flutter/playx_core issue_tracker: https://github.com/playx-flutter/playx_core/issues @@ -20,7 +20,7 @@ dependencies: shared_preferences: ^2.3.5 equatable: ^2.0.7 sprintf: ^7.0.0 - flutter_secure_storage: ^10.0.0-beta.2 + flutter_secure_storage: ^10.0.0-beta.4 flutter_dotenv: ^5.2.1 get_it: ^8.0.3 worker_manager: ^7.2.2 From ee29599f018faf1aef4710c4fe27da3d7cdab21c Mon Sep 17 00:00:00 2001 From: Basem Osama Date: Sun, 19 Jan 2025 17:38:36 +0200 Subject: [PATCH 05/17] refactor: Update to v1.0.0-beta.2 - CU-86c1jfhc3 Signed-off-by: Basem Osama --- .flutter-plugins | 10 +++++----- .flutter-plugins-dependencies | 2 +- example/pubspec.lock | 30 +++++++++++++++++++----------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.flutter-plugins b/.flutter-plugins index d72f1a8..1d34678 100644 --- a/.flutter-plugins +++ b/.flutter-plugins @@ -1,9 +1,9 @@ # This is a generated file; do not edit or check into version control. -flutter_secure_storage=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage-9.2.4\\ -flutter_secure_storage_linux=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage_linux-1.2.2\\ -flutter_secure_storage_macos=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage_macos-3.1.3\\ -flutter_secure_storage_web=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage_web-1.2.1\\ -flutter_secure_storage_windows=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage_windows-3.1.2\\ +flutter_secure_storage=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage-10.0.0-beta.4\\ +flutter_secure_storage_darwin=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage_darwin-0.1.0\\ +flutter_secure_storage_linux=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage_linux-2.0.1\\ +flutter_secure_storage_web=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage_web-2.0.0\\ +flutter_secure_storage_windows=E:\\Sdk\\cache\\hosted\\pub.dev\\flutter_secure_storage_windows-4.0.0\\ path_provider=E:\\Sdk\\cache\\hosted\\pub.dev\\path_provider-2.0.15\\ path_provider_android=E:\\Sdk\\cache\\hosted\\pub.dev\\path_provider_android-2.0.27\\ path_provider_foundation=E:\\Sdk\\cache\\hosted\\pub.dev\\path_provider_foundation-2.2.4\\ diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index e8fd84d..2859ba8 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage-9.2.4\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.5.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage-9.2.4\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_android-2.4.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_secure_storage_macos","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_macos-3.1.3\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.5.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_secure_storage_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_linux-1.2.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.1.10\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_linux-2.4.1\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"flutter_secure_storage_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_windows-3.1.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_windows-2.4.1\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"flutter_secure_storage_web","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_web-1.2.1\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_web-2.4.2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2025-01-19 17:29:57.758741","version":"3.27.2","swift_package_manager_enabled":false} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage_darwin","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_darwin-0.1.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.5.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage-10.0.0-beta.4\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_android-2.4.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_secure_storage_darwin","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_darwin-0.1.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.5.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_secure_storage_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_linux-2.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.1.10\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_linux-2.4.1\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"flutter_secure_storage_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_windows-4.0.0\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_windows-2.4.1\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"flutter_secure_storage_web","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_web-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_web-2.4.2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_darwin","flutter_secure_storage_linux","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_darwin","dependencies":[]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2025-01-19 17:37:09.273582","version":"3.27.2","swift_package_manager_enabled":false} \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index f651361..8606803 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -106,26 +106,26 @@ packages: dependency: transitive description: name: flutter_secure_storage - sha256: c0f1abb088adddc193286ea91eedd71900ec5707ac86503a7ae09d88c9ffc22b + sha256: f7eceb0bc6f4fd0441e29d43cab9ac2a1c5ffd7ea7b64075136b718c46954874 url: "https://pub.dev" source: hosted - version: "10.0.0-beta.2" - flutter_secure_storage_linux: + version: "10.0.0-beta.4" + flutter_secure_storage_darwin: dependency: transitive description: - name: flutter_secure_storage_linux - sha256: b777e220fbf21c149574aa31f9e4ed56dcf025c4ef196664fe90954c265105dc + name: flutter_secure_storage_darwin + sha256: f226f2a572bed96bc6542198ebaec227150786e34311d455a7e2d3d06d951845 url: "https://pub.dev" source: hosted - version: "2.0.0" - flutter_secure_storage_macos: + version: "0.1.0" + flutter_secure_storage_linux: dependency: transitive description: - name: flutter_secure_storage_macos - sha256: "75894eb6b402ac7f7f5ee5487d651b87855a338e26eb6993f4b2fce33013a615" + name: flutter_secure_storage_linux + sha256: b777e220fbf21c149574aa31f9e4ed56dcf025c4ef196664fe90954c265105dc url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "2.0.0" flutter_secure_storage_platform_interface: dependency: transitive description: @@ -294,7 +294,7 @@ packages: path: ".." relative: true source: path - version: "1.0.0-beta.1" + version: "1.0.0-beta.2" plugin_platform_interface: dependency: transitive description: @@ -452,6 +452,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.10.0" + worker_manager: + dependency: transitive + description: + name: worker_manager + sha256: "0c6c4e7d246bcbe7221273ef955732dafb097347d536ebe6acd6547d0398c49c" + url: "https://pub.dev" + source: hosted + version: "7.2.2" xdg_directories: dependency: transitive description: From fc572de9b5baf9c6746ddcaf978ec94bb23d3a4c Mon Sep 17 00:00:00 2001 From: Basem Osama Date: Sun, 19 Jan 2025 19:39:16 +0200 Subject: [PATCH 06/17] refactor: Update to v1.0.0-beta.3 - CU-86c1jfhc3 Signed-off-by: Basem Osama --- .flutter-plugins-dependencies | 2 +- CHANGELOG.md | 4 ++++ pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 2859ba8..a367d9a 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage_darwin","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_darwin-0.1.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.5.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage-10.0.0-beta.4\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_android-2.4.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_secure_storage_darwin","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_darwin-0.1.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.5.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_secure_storage_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_linux-2.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.1.10\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_linux-2.4.1\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"flutter_secure_storage_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_windows-4.0.0\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_windows-2.4.1\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"flutter_secure_storage_web","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_web-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_web-2.4.2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_darwin","flutter_secure_storage_linux","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_darwin","dependencies":[]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2025-01-19 17:37:09.273582","version":"3.27.2","swift_package_manager_enabled":false} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage_darwin","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_darwin-0.1.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.5.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage-10.0.0-beta.4\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.0.27\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_android-2.4.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_secure_storage_darwin","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_darwin-0.1.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.2.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.5.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_secure_storage_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_linux-2.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.1.10\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_linux-2.4.1\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"flutter_secure_storage_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_windows-4.0.0\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_windows-2.4.1\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"flutter_secure_storage_web","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\flutter_secure_storage_web-2.0.0\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"E:\\\\Sdk\\\\cache\\\\hosted\\\\pub.dev\\\\shared_preferences_web-2.4.2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_darwin","flutter_secure_storage_linux","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_darwin","dependencies":[]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2025-01-19 19:39:11.813509","version":"3.27.2","swift_package_manager_enabled":false} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d70dc01..de2bb76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +# 1.0.0-beta.3 +- Add new `printError` param to `**MapUtils** mapAsync` and `mapAsyncInIsolate` methods to determine whether to print errors or not. +- Update `asyncMapInIsolate` in `NestedIterablesExtensions` to include a `printError` parameter and `printEachItemError` parameter to determine whether to print errors for each item or not. + # 1.0.0-beta.2 > Note: This release has breaking changes. diff --git a/pubspec.yaml b/pubspec.yaml index d06093a..f5e1781 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: playx_core description: Core package for playx eco system contains shared classes and utilities. -version: 1.0.0-beta.2 +version: 1.0.0-beta.3 homepage: https://github.com/playx-flutter/playx_core repository: https://github.com/playx-flutter/playx_core issue_tracker: https://github.com/playx-flutter/playx_core/issues From de3c1fe113ec573eb45388da5e8c148b804c1612 Mon Sep 17 00:00:00 2001 From: basemosama Date: Sun, 29 Jun 2025 17:26:26 +0300 Subject: [PATCH 07/17] chore: Update version to 1.0.0-beta.4 and add new dependencies --- example/android/app/build.gradle.kts | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 112 +++++++++++++ .../xcshareddata/xcschemes/Runner.xcscheme | 2 + .../contents.xcworkspacedata | 3 + .../flutter/generated_plugin_registrant.cc | 4 + example/linux/flutter/generated_plugins.cmake | 1 + .../Flutter/GeneratedPluginRegistrant.swift | 6 +- example/pubspec.lock | 154 +++++++++++++++--- .../flutter/generated_plugin_registrant.cc | 6 + .../windows/flutter/generated_plugins.cmake | 2 + pubspec.lock | 152 ++++++++++++++--- pubspec.yaml | 3 +- 12 files changed, 402 insertions(+), 45 deletions(-) diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts index 21ecea9..02bb4f6 100644 --- a/example/android/app/build.gradle.kts +++ b/example/android/app/build.gradle.kts @@ -24,7 +24,7 @@ android { applicationId = "com.example.example" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. - minSdk = flutter.minSdkVersion + minSdk = 23 targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index ce3bc8f..bbd00fc 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -10,10 +10,12 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 73BC386FF185168D368BCD29 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 863C04B67E328E5442751233 /* Pods_RunnerTests.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + C9A3629E6DB8B8377A5BD559 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A404B48CA76AD5F2C860C0D4 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -42,12 +44,17 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 21AABD4650D7E0AE46EB7EA1 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 298F2FA6CD29C22068029D4C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 48D2EA585A2F45A704B0658C /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 6C007A78EEB35EB77FFD47A5 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 863C04B67E328E5442751233 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -55,13 +62,25 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A404B48CA76AD5F2C860C0D4 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + AF34958545D6715C065D1644 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + B5A05A462786EDFED5893CE4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 8A933DEE4F67978A6D4BD250 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 73BC386FF185168D368BCD29 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C9A3629E6DB8B8377A5BD559 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -76,6 +95,29 @@ path = RunnerTests; sourceTree = ""; }; + 39329551489067E47B6ACE5D /* Pods */ = { + isa = PBXGroup; + children = ( + 298F2FA6CD29C22068029D4C /* Pods-Runner.debug.xcconfig */, + 6C007A78EEB35EB77FFD47A5 /* Pods-Runner.release.xcconfig */, + B5A05A462786EDFED5893CE4 /* Pods-Runner.profile.xcconfig */, + 48D2EA585A2F45A704B0658C /* Pods-RunnerTests.debug.xcconfig */, + AF34958545D6715C065D1644 /* Pods-RunnerTests.release.xcconfig */, + 21AABD4650D7E0AE46EB7EA1 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 54AD0ACBB5D809430402F4FE /* Frameworks */ = { + isa = PBXGroup; + children = ( + A404B48CA76AD5F2C860C0D4 /* Pods_Runner.framework */, + 863C04B67E328E5442751233 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -94,6 +136,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, + 39329551489067E47B6ACE5D /* Pods */, + 54AD0ACBB5D809430402F4FE /* Frameworks */, ); sourceTree = ""; }; @@ -128,8 +172,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + 148BDBF764E0A6F1903B5C5A /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, + 8A933DEE4F67978A6D4BD250 /* Frameworks */, ); buildRules = ( ); @@ -145,12 +191,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 992F2ED3B753797AA8B5DE47 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + AADCC56E37E9AD82B69CA6EA /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -222,6 +270,28 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 148BDBF764E0A6F1903B5C5A /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -253,6 +323,45 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + 992F2ED3B753797AA8B5DE47 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + AADCC56E37E9AD82B69CA6EA /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -378,6 +487,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 48D2EA585A2F45A704B0658C /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -395,6 +505,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = AF34958545D6715C065D1644 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -410,6 +521,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 21AABD4650D7E0AE46EB7EA1 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 15cada4..e3773d4 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> + + diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc index d0e7f79..38dd0bc 100644 --- a/example/linux/flutter/generated_plugin_registrant.cc +++ b/example/linux/flutter/generated_plugin_registrant.cc @@ -7,9 +7,13 @@ #include "generated_plugin_registrant.h" #include +#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index b29e9ba..65240e9 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_secure_storage_linux + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index 37af1fe..49858b0 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,12 +5,14 @@ import FlutterMacOS import Foundation -import flutter_secure_storage_macos +import flutter_secure_storage_darwin import path_provider_foundation +import share_plus import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) + FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/example/pubspec.lock b/example/pubspec.lock index 9f3a7c5..81304ae 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -49,6 +49,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" cupertino_icons: dependency: "direct main" description: @@ -89,6 +105,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -114,50 +138,50 @@ packages: dependency: transitive description: name: flutter_secure_storage - sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" + sha256: f7eceb0bc6f4fd0441e29d43cab9ac2a1c5ffd7ea7b64075136b718c46954874 url: "https://pub.dev" source: hosted - version: "9.2.4" - flutter_secure_storage_linux: + version: "10.0.0-beta.4" + flutter_secure_storage_darwin: dependency: transitive description: - name: flutter_secure_storage_linux - sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 + name: flutter_secure_storage_darwin + sha256: f226f2a572bed96bc6542198ebaec227150786e34311d455a7e2d3d06d951845 url: "https://pub.dev" source: hosted - version: "1.2.2" - flutter_secure_storage_macos: + version: "0.1.0" + flutter_secure_storage_linux: dependency: transitive description: - name: flutter_secure_storage_macos - sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + name: flutter_secure_storage_linux + sha256: "9b4b73127e857cd3117d43a70fa3dddadb6e0b253be62e6a6ab85caa0742182c" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "2.0.1" flutter_secure_storage_platform_interface: dependency: transitive description: name: flutter_secure_storage_platform_interface - sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.1" flutter_secure_storage_web: dependency: transitive description: name: flutter_secure_storage_web - sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + sha256: "4c3f233e739545c6cb09286eeec1cc4744138372b985113acc904f7263bef517" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "2.0.0" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + sha256: ff32af20f70a8d0e59b2938fc92de35b54a74671041c814275afd80e27df9f21 url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "4.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -176,14 +200,14 @@ packages: url: "https://pub.dev" source: hosted version: "8.0.3" - js: + group_button: dependency: transitive description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: group_button + sha256: "0610fcf28ed122bfb4b410fce161a390f7f2531d55d1d65c5375982001415940" url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "5.3.4" leak_tracker: dependency: transitive description: @@ -240,6 +264,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" path: dependency: transitive description: @@ -310,7 +342,7 @@ packages: path: ".." relative: true source: path - version: "0.7.1" + version: "1.0.0-beta.4" plugin_platform_interface: dependency: transitive description: @@ -319,6 +351,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.7" + share_plus: + dependency: transitive + description: + name: share_plus + sha256: b2961506569e28948d75ec346c28775bb111986bb69dc6a20754a457e3d97fa0 + url: "https://pub.dev" + source: hosted + version: "11.0.0" + share_plus_platform_interface: + dependency: transitive + description: + name: share_plus_platform_interface + sha256: "1032d392bc5d2095a77447a805aa3f804d2ae6a4d5eef5e6ebb3bd94c1bc19ef" + url: "https://pub.dev" + source: hosted + version: "6.0.0" shared_preferences: dependency: transitive description: @@ -420,6 +468,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.1" + talker: + dependency: transitive + description: + name: talker + sha256: cf02a0d294701c76022f32bc8eb7e6f943953eb17fa1f8aaee56af210848134b + url: "https://pub.dev" + source: hosted + version: "4.9.1" + talker_flutter: + dependency: transitive + description: + name: talker_flutter + sha256: "9573cca369b964c8a8d34f422b74d4b934ac64341dd31560352fe458ba6b7894" + url: "https://pub.dev" + source: hosted + version: "4.9.1" talker_logger: dependency: transitive description: @@ -444,6 +508,54 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.4" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + url: "https://pub.dev" + source: hosted + version: "3.1.4" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" vector_math: dependency: transitive description: diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index 0c50753..be05421 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -7,8 +7,14 @@ #include "generated_plugin_registrant.h" #include +#include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { FlutterSecureStorageWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); + SharePlusWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 4fc759c..7b6e42f 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -4,6 +4,8 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_secure_storage_windows + share_plus + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/pubspec.lock b/pubspec.lock index cc03ebf..5df964f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -49,6 +49,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" + url: "https://pub.dev" + source: hosted + version: "0.3.4+2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" equatable: dependency: "direct main" description: @@ -81,6 +97,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -106,50 +130,50 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" + sha256: f7eceb0bc6f4fd0441e29d43cab9ac2a1c5ffd7ea7b64075136b718c46954874 url: "https://pub.dev" source: hosted - version: "9.2.4" - flutter_secure_storage_linux: + version: "10.0.0-beta.4" + flutter_secure_storage_darwin: dependency: transitive description: - name: flutter_secure_storage_linux - sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 + name: flutter_secure_storage_darwin + sha256: f226f2a572bed96bc6542198ebaec227150786e34311d455a7e2d3d06d951845 url: "https://pub.dev" source: hosted - version: "1.2.3" - flutter_secure_storage_macos: + version: "0.1.0" + flutter_secure_storage_linux: dependency: transitive description: - name: flutter_secure_storage_macos - sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + name: flutter_secure_storage_linux + sha256: "9b4b73127e857cd3117d43a70fa3dddadb6e0b253be62e6a6ab85caa0742182c" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "2.0.1" flutter_secure_storage_platform_interface: dependency: transitive description: name: flutter_secure_storage_platform_interface - sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + sha256: "8ceea1223bee3c6ac1a22dabd8feefc550e4729b3675de4b5900f55afcb435d6" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.1" flutter_secure_storage_web: dependency: transitive description: name: flutter_secure_storage_web - sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + sha256: "4c3f233e739545c6cb09286eeec1cc4744138372b985113acc904f7263bef517" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "2.0.0" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + sha256: ff32af20f70a8d0e59b2938fc92de35b54a74671041c814275afd80e27df9f21 url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "4.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -168,14 +192,14 @@ packages: url: "https://pub.dev" source: hosted version: "8.0.3" - js: + group_button: dependency: transitive description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: group_button + sha256: "0610fcf28ed122bfb4b410fce161a390f7f2531d55d1d65c5375982001415940" url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "5.3.4" leak_tracker: dependency: transitive description: @@ -232,6 +256,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" path: dependency: transitive description: @@ -304,6 +336,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + share_plus: + dependency: transitive + description: + name: share_plus + sha256: b2961506569e28948d75ec346c28775bb111986bb69dc6a20754a457e3d97fa0 + url: "https://pub.dev" + source: hosted + version: "11.0.0" + share_plus_platform_interface: + dependency: transitive + description: + name: share_plus_platform_interface + sha256: "1032d392bc5d2095a77447a805aa3f804d2ae6a4d5eef5e6ebb3bd94c1bc19ef" + url: "https://pub.dev" + source: hosted + version: "6.0.0" shared_preferences: dependency: "direct main" description: @@ -405,6 +453,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.1" + talker: + dependency: transitive + description: + name: talker + sha256: cf02a0d294701c76022f32bc8eb7e6f943953eb17fa1f8aaee56af210848134b + url: "https://pub.dev" + source: hosted + version: "4.9.1" + talker_flutter: + dependency: "direct main" + description: + name: talker_flutter + sha256: "9573cca369b964c8a8d34f422b74d4b934ac64341dd31560352fe458ba6b7894" + url: "https://pub.dev" + source: hosted + version: "4.9.1" talker_logger: dependency: "direct main" description: @@ -429,6 +493,54 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.4" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + url: "https://pub.dev" + source: hosted + version: "3.1.4" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 3246a29..6a54025 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: playx_core description: Core package for playx eco system contains shared classes and utilities. -version: 1.0.0-beta.3 +version: 1.0.0-beta.4 homepage: https://github.com/playx-flutter/playx_core repository: https://github.com/playx-flutter/playx_core issue_tracker: https://github.com/playx-flutter/playx_core/issues @@ -27,6 +27,7 @@ dependencies: worker_manager: ^7.2.6 talker_logger: ^4.9.1 web: ^1.1.1 + talker_flutter: ^4.9.1 dev_dependencies: flutter_test: From a4d17255f15b37dca0cdd7bfa00169bc2e2ac57e Mon Sep 17 00:00:00 2001 From: basemosama Date: Sun, 29 Jun 2025 17:26:56 +0300 Subject: [PATCH 08/17] chore: Update version to 1.0.0-beta.4 and add new dependencies --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e61d437..80f7f72 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,4 @@ .fvm/ /.fvmrc /ios/._Runner.xcworkspace +/example/ios/Podfile.lock From 6d5042b445f3b0e094be4deeaaeae5f9138b7fdd Mon Sep 17 00:00:00 2001 From: basemosama Date: Sun, 29 Jun 2025 17:27:05 +0300 Subject: [PATCH 09/17] feat: Enhance logging methods to include message and tag parameters --- lib/src/logger/base_logger.dart | 16 ++++++++-------- lib/src/logger/playx_logger.dart | 18 +++++++++++++++++- lib/src/logger/playx_logger_settings.dart | 2 +- lib/src/playx_core.dart | 8 ++++---- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/lib/src/logger/base_logger.dart b/lib/src/logger/base_logger.dart index b8cdf96..86d313a 100644 --- a/lib/src/logger/base_logger.dart +++ b/lib/src/logger/base_logger.dart @@ -30,25 +30,25 @@ abstract class PlayxBaseLogger { void log(dynamic message, {String? tag}); /// Alias for [debug] - void d(dynamic message, {String? tag}) => debug; + void d(dynamic message, {String? tag}) => debug(message, tag: tag); /// Alias for [info] - void i(dynamic message, {String? tag}) => info; + void i(dynamic message, {String? tag}) => info(message, tag: tag); /// Alias for [warning] - void w(dynamic message, {String? tag}) => warning; + void w(dynamic message, {String? tag}) => warning(message, tag: tag); /// Alias for [error] void e(dynamic message, - {Object? error, StackTrace? stackTrace, String? tag}) => - error; + {Object? error, StackTrace? stackTrace, String? tag}) => this.error(message, + error: error, stackTrace: stackTrace, tag: tag); /// Alias for [critical] - void c(dynamic message, {String? tag}) => critical; + void c(dynamic message, {String? tag}) => critical(message, tag: tag); /// Alias for [good] - void v(dynamic message, {String? tag}) => verbose; + void v(dynamic message, {String? tag}) => verbose(message, tag: tag); /// Alias for [log] - void l(dynamic message, {String? tag}) => log; + void l(dynamic message, {String? tag}) => log(message, tag: tag); } diff --git a/lib/src/logger/playx_logger.dart b/lib/src/logger/playx_logger.dart index cd6da6e..23eb4c2 100644 --- a/lib/src/logger/playx_logger.dart +++ b/lib/src/logger/playx_logger.dart @@ -1,6 +1,17 @@ +import 'package:talker_flutter/talker_flutter.dart'; + import 'talker_playx_logger.dart'; import 'playx_logger_settings.dart'; import 'base_logger.dart'; +class DefaultColoredLoggerFormatter implements LoggerFormatter { + @override + String fmt(LogDetails details, TalkerLoggerSettings settings) { + final msg = details.message?.toString() ?? ''; + final coloredMsg = + msg.split('\n').map((e) => details.pen.write(e)).toList().join('\n'); + return coloredMsg; + } +} /// A centralized static logger utility for Playx-based applications. /// @@ -40,9 +51,12 @@ class PlayxLogger { String? name, PlayxLoggerSettings? settings, bool setAsDefault = true, + bool useColoredFormatter = false, }) { final logger = TalkerPlayxLogger( - settings: settings ?? PlayxLoggerSettings(), name: name); + settings: settings ?? PlayxLoggerSettings( + formatter: useColoredFormatter? DefaultColoredLoggerFormatter() : ExtendedLoggerFormatter(), + ), name: name); name ??= 'PLAYX LOGGER'; _loggers[name] = logger; @@ -51,6 +65,8 @@ class PlayxLogger { } } + + /// Retrieves a logger instance by its [name]. /// /// Returns `null` if no logger exists with the given name. diff --git a/lib/src/logger/playx_logger_settings.dart b/lib/src/logger/playx_logger_settings.dart index 74f5cbf..fcfb3d6 100644 --- a/lib/src/logger/playx_logger_settings.dart +++ b/lib/src/logger/playx_logger_settings.dart @@ -68,7 +68,7 @@ class PlayxLoggerSettings { this.printDateTime = false, this.level = LogLevel.verbose, this.lineSymbol = '─', - this.maxLineWidth = 110, + this.maxLineWidth = 140, this.formatter = const ExtendedLoggerFormatter(), this.output, this.filter, diff --git a/lib/src/playx_core.dart b/lib/src/playx_core.dart index e367997..76667b2 100644 --- a/lib/src/playx_core.dart +++ b/lib/src/playx_core.dart @@ -102,8 +102,8 @@ abstract class PlayxCore { PlayxPrefsSettings prefsSettings = const PlayxPrefsSettings(), WorkManagerSettings workerManagerSettings = const WorkManagerSettings(), }) async { - PlayxLogger.initLogger(name: 'PLAYX CORE'); - logger.debug('Booting Preferences...'); + PlayxLogger.initLogger(name: 'PLAYX CORE', useColoredFormatter: true); + logger.i('Booting Preferences...'); if (prefsSettings.createPlayxPrefs) { await PlayxPrefs.create(); } @@ -120,7 +120,7 @@ abstract class PlayxCore { await PlayxSecurePrefs.create(securePrefsSettings: securePrefsSettings); } - logger.d('Booting Environment...'); + logger.i('Booting Environment...'); if (envSettings != null) { await PlayxEnv.load( fileName: envSettings.fileName, @@ -138,7 +138,7 @@ abstract class PlayxCore { } _getIt = GetIt.instance; - logger.debug('PlayxCore initialized'); + logger.i('PlayxCore initialized'); } /// Disposes the resources used by `playx_core`. From 5211cdf9c54fb26d1b29e37dafad0128bc7ef734 Mon Sep 17 00:00:00 2001 From: basemosama Date: Sun, 29 Jun 2025 17:33:45 +0300 Subject: [PATCH 10/17] refactor: code cleanup --- .vscode/settings.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 0df1cdd..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cSpell.words": ["playx"] -} From 9650afd7a5f6c40bc69cd05d3425f2b42f5a6166 Mon Sep 17 00:00:00 2001 From: basemosama Date: Sun, 29 Jun 2025 18:35:47 +0300 Subject: [PATCH 11/17] feat: Update logger import and modify initLogger to return logger instance --- lib/src/logger/playx_logger.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/logger/playx_logger.dart b/lib/src/logger/playx_logger.dart index 23eb4c2..16c1940 100644 --- a/lib/src/logger/playx_logger.dart +++ b/lib/src/logger/playx_logger.dart @@ -1,8 +1,9 @@ -import 'package:talker_flutter/talker_flutter.dart'; - +import 'package:talker_logger/talker_logger.dart'; import 'talker_playx_logger.dart'; import 'playx_logger_settings.dart'; import 'base_logger.dart'; + +/// A default logger formatter that uses colored output for log messages. class DefaultColoredLoggerFormatter implements LoggerFormatter { @override String fmt(LogDetails details, TalkerLoggerSettings settings) { @@ -47,7 +48,7 @@ class PlayxLogger { /// /// When [setAsDefault] is `true` (default), this logger will be assigned /// as the default logger for static logging methods like [debug], [error], etc. - static void initLogger({ + static PlayxBaseLogger initLogger({ String? name, PlayxLoggerSettings? settings, bool setAsDefault = true, @@ -63,6 +64,7 @@ class PlayxLogger { if (setAsDefault || _defaultLogger == null) { _defaultLogger = logger; } + return logger; } From ad9b048684050a18aed0a4948c553b2a9a703337 Mon Sep 17 00:00:00 2001 From: basemosama Date: Sun, 29 Jun 2025 18:38:14 +0300 Subject: [PATCH 12/17] chore: Update version to 1.0.0-beta.5 and modify changelog --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 086b914..49a2f7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Changelog -# 1.0.0-beta.4 +# 1.0.0-beta.4 - 1.0.0-beta.5 - Added v0.7.0 changes. # 1.0.0-beta.3 diff --git a/pubspec.yaml b/pubspec.yaml index 6a54025..e2884bf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: playx_core description: Core package for playx eco system contains shared classes and utilities. -version: 1.0.0-beta.4 +version: 1.0.0-beta.5 homepage: https://github.com/playx-flutter/playx_core repository: https://github.com/playx-flutter/playx_core issue_tracker: https://github.com/playx-flutter/playx_core/issues From 1d5bf1f883305dda396f602a189a650db0b95911 Mon Sep 17 00:00:00 2001 From: basemosama Date: Tue, 18 Nov 2025 00:12:31 +0200 Subject: [PATCH 13/17] feat: Update to v0.7.4 - CU-86c6jt5r6 (cherry picked from commit 65fded1608548588ed1d576a933e193ff4c04361) --- CHANGELOG.md | 9 ++++++++- lib/src/utils/safe_json_convert.dart | 10 ++++++++++ pubspec.yaml | 13 ++++++------- test/extensions/context/colors_test.dart | 3 ++- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49a2f7f..c0f35ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog + +## 0.7.4 +- Update packages +- Add new asTOr and asT safe json convert functions. + # 1.0.0-beta.4 - 1.0.0-beta.5 - Added v0.7.0 changes. @@ -7,6 +12,9 @@ - Update `asyncMapInIsolate` in `NestedIterablesExtensions` to include a `printError` parameter and `printEachItemError` parameter to determine whether to print errors for each item or not. +## 0.7.2-0.7.3 +- Enhance logging methods in `PlayxCore` to use the new `PlayxLogger` system. + # 1.0.0-beta.2 > Note: This release has breaking changes. @@ -109,7 +117,6 @@ This version introduces a **modern, powerful, and highly configurable logging sy - Update packages. - Updates minimum supported SDK version to Flutter 3.24/Dart 3.5. - ## 0.6.1 - Add new `printError` param to `**MapUtils** mapAsync` and `mapAsyncInIsolate` methods to determine whether to print errors or not. - Update `asyncMapInIsolate` in `NestedIterablesExtensions` to include a `printError` parameter and `printEachItemError` parameter to determine whether to print errors for each item or not. diff --git a/lib/src/utils/safe_json_convert.dart b/lib/src/utils/safe_json_convert.dart index 98c7335..9ff9468 100644 --- a/lib/src/utils/safe_json_convert.dart +++ b/lib/src/utils/safe_json_convert.dart @@ -304,3 +304,13 @@ T? asTOrNull(dynamic json, String key, } return null; } + +T asTOr(dynamic json, String key, + {T Function(dynamic json)? fromJson, required T fallback}) { + return asTOrNull(json, key, fromJson: fromJson) ?? fallback; +} + +T asT(dynamic json, String key, {T Function(dynamic json)? fromJson}) { + return asTOrNull(json, key, fromJson: fromJson) ?? + (throw FormatException('Invalid <$T> value for key: $key')); +} diff --git a/pubspec.yaml b/pubspec.yaml index e2884bf..a23eec6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: playx_core description: Core package for playx eco system contains shared classes and utilities. version: 1.0.0-beta.5 -homepage: https://github.com/playx-flutter/playx_core +homepage: https://sourcya.io/ repository: https://github.com/playx-flutter/playx_core issue_tracker: https://github.com/playx-flutter/playx_core/issues topics: @@ -12,7 +12,7 @@ topics: - env environment: - sdk: ">=3.5.0 <4.0.0" + sdk: ^3.5.0 flutter: ">=3.24.0" dependencies: @@ -22,12 +22,11 @@ dependencies: equatable: ^2.0.7 sprintf: ^7.0.0 flutter_secure_storage: ^10.0.0-beta.4 - flutter_dotenv: ^5.2.1 - get_it: ^8.0.3 - worker_manager: ^7.2.6 - talker_logger: ^4.9.1 + flutter_dotenv: ^6.0.0 + get_it: ^9.0.5 + worker_manager: ^7.2.7 + talker_logger: ^5.0.2 web: ^1.1.1 - talker_flutter: ^4.9.1 dev_dependencies: flutter_test: diff --git a/test/extensions/context/colors_test.dart b/test/extensions/context/colors_test.dart index 7fde903..882b3c6 100644 --- a/test/extensions/context/colors_test.dart +++ b/test/extensions/context/colors_test.dart @@ -97,7 +97,8 @@ void main() { await tester.pumpWidget( MaterialApp( theme: ThemeData( - bottomAppBarTheme: const BottomAppBarTheme(color: Color(0xFF00FF00)), + bottomAppBarTheme: + const BottomAppBarThemeData(color: Color(0xFF00FF00)), ), home: Builder( builder: (context) { From c030615b0f4e5f5732584e3dd5db44162b57b9d6 Mon Sep 17 00:00:00 2001 From: basemosama Date: Tue, 18 Nov 2025 00:18:46 +0200 Subject: [PATCH 14/17] feat: Update REadme- CU-86c6jt5r6 --- CHANGELOG.md | 4 ++++ pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f35ac..e06fac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.0-beta.6 +- Update packages + + ## 0.7.4 - Update packages - Add new asTOr and asT safe json convert functions. diff --git a/pubspec.yaml b/pubspec.yaml index a23eec6..d0a1ee0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: playx_core description: Core package for playx eco system contains shared classes and utilities. -version: 1.0.0-beta.5 +version: 1.0.0-beta.6 homepage: https://sourcya.io/ repository: https://github.com/playx-flutter/playx_core issue_tracker: https://github.com/playx-flutter/playx_core/issues From 57416a6a69cbc2bf1473d23f077b56ceac7b6057 Mon Sep 17 00:00:00 2001 From: basemosama Date: Tue, 18 Nov 2025 00:20:33 +0200 Subject: [PATCH 15/17] refactor : apply dart format- CU-86c6jt5r6 --- lib/src/logger/base_logger.dart | 4 ++-- lib/src/logger/playx_logger.dart | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/src/logger/base_logger.dart b/lib/src/logger/base_logger.dart index 86d313a..888445b 100644 --- a/lib/src/logger/base_logger.dart +++ b/lib/src/logger/base_logger.dart @@ -40,8 +40,8 @@ abstract class PlayxBaseLogger { /// Alias for [error] void e(dynamic message, - {Object? error, StackTrace? stackTrace, String? tag}) => this.error(message, - error: error, stackTrace: stackTrace, tag: tag); + {Object? error, StackTrace? stackTrace, String? tag}) => + this.error(message, error: error, stackTrace: stackTrace, tag: tag); /// Alias for [critical] void c(dynamic message, {String? tag}) => critical(message, tag: tag); diff --git a/lib/src/logger/playx_logger.dart b/lib/src/logger/playx_logger.dart index 16c1940..d64b803 100644 --- a/lib/src/logger/playx_logger.dart +++ b/lib/src/logger/playx_logger.dart @@ -9,7 +9,7 @@ class DefaultColoredLoggerFormatter implements LoggerFormatter { String fmt(LogDetails details, TalkerLoggerSettings settings) { final msg = details.message?.toString() ?? ''; final coloredMsg = - msg.split('\n').map((e) => details.pen.write(e)).toList().join('\n'); + msg.split('\n').map((e) => details.pen.write(e)).toList().join('\n'); return coloredMsg; } } @@ -55,9 +55,13 @@ class PlayxLogger { bool useColoredFormatter = false, }) { final logger = TalkerPlayxLogger( - settings: settings ?? PlayxLoggerSettings( - formatter: useColoredFormatter? DefaultColoredLoggerFormatter() : ExtendedLoggerFormatter(), - ), name: name); + settings: settings ?? + PlayxLoggerSettings( + formatter: useColoredFormatter + ? DefaultColoredLoggerFormatter() + : ExtendedLoggerFormatter(), + ), + name: name); name ??= 'PLAYX LOGGER'; _loggers[name] = logger; @@ -67,8 +71,6 @@ class PlayxLogger { return logger; } - - /// Retrieves a logger instance by its [name]. /// /// Returns `null` if no logger exists with the given name. From a76c92dba5ebb3a9f5131feedd735ce6f7e9b57f Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 1 Apr 2026 15:01:22 +0200 Subject: [PATCH 16/17] chore: Update to v1.0.0 ## 1.0.0 - Added support for nested JSON keys using dot notation (e.g., `'data.user.name'`) in all `safe_json_convert` functions. - Introduced `toEnum`/`asEnum` and `toUri`/`asUri` safe conversion functions. - Improved generic list parsing in `toListOrNull` by adding a fallback to `List.from(value)` for safer runtime casting. - Optimized `TalkerPlayxLogger` to strictly respect the `enabled` configuration, utilize `debugPrint`, and automatically disable colored output in Web environments to avoid unformatted ANSI codes. - Refactored `PlayxColorExtensions` to eliminate deprecated `dart:ui` getters, transitioning to Flutter 3.24 wide-gamut compatibility (`a`, `r`, `g`, `b`). Added `fromHex`, `lighten`, `darken`, and `isDark` helper methods. - Expanded core extension libraries (`String`, `Iterable`, `DateTime`, `Duration`, `bool`, `BuildContext`) to include new highly-requested utilities: - **String**: Added helpers like `toIntOrNull()`, `isNumeric`, `isValidEmail`, `toSlug()`, and `NullableStringExtensions` on `String?` (e.g., `isNullOrEmpty`). - **Iterable**: Added functional utilities `chunked`, `groupBy`, `sortedBy`, and numeric aggregates (`sum`, `average`). - **DateTime**: Added boundary generators like `startOfDay`, `endOfMonth`, and `startOfWeek`. - **Context**: Mapped the complete Material 3 `ColorScheme` properties (e.g., `onPrimary`, `surfaceContainer`) directly to `BuildContext` for agile theming. --- CHANGELOG.md | 14 +- .../flutter/generated_plugin_registrant.cc | 4 - example/linux/flutter/generated_plugins.cmake | 1 - .../Flutter/GeneratedPluginRegistrant.swift | 2 - example/pubspec.lock | 194 ++++------------- .../flutter/generated_plugin_registrant.cc | 6 - .../windows/flutter/generated_plugins.cmake | 2 - lib/generated/assets.dart | 94 +++++++++ lib/src/extensions/bool_extensions.dart | 9 + lib/src/extensions/color_extensions.dart | 58 +++++- lib/src/extensions/context/colors.dart | 32 +++ lib/src/extensions/date_time_extensions.dart | 25 +++ lib/src/extensions/duration_extensions.dart | 7 + lib/src/extensions/iterable_extensions.dart | 57 +++++ lib/src/extensions/string_extensions.dart | 55 +++++ lib/src/logger/playx_logger.dart | 3 + lib/src/logger/playx_logger_settings.dart | 2 +- lib/src/logger/talker_playx_logger.dart | 24 ++- lib/src/utils/mapper_utilities.dart | 2 +- lib/src/utils/safe_convert.dart | 53 +++++ lib/src/utils/safe_json_convert.dart | 77 ++++++- pubspec.lock | 196 ++++-------------- pubspec.yaml | 14 +- test_color.dart | 10 + 24 files changed, 581 insertions(+), 360 deletions(-) create mode 100644 lib/generated/assets.dart create mode 100644 test_color.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index e06fac5..213c81b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,16 @@ # Changelog -## 1.0.0-beta.6 -- Update packages - +## 1.0.0 +- Added support for nested JSON keys using dot notation (e.g., `'data.user.name'`) in all `safe_json_convert` functions. +- Introduced `toEnum`/`asEnum` and `toUri`/`asUri` safe conversion functions. +- Improved generic list parsing in `toListOrNull` by adding a fallback to `List.from(value)` for safer runtime casting. +- Optimized `TalkerPlayxLogger` to strictly respect the `enabled` configuration, utilize `debugPrint`, and automatically disable colored output in Web environments to avoid unformatted ANSI codes. +- Refactored `PlayxColorExtensions` to eliminate deprecated `dart:ui` getters, transitioning to Flutter 3.24 wide-gamut compatibility (`a`, `r`, `g`, `b`). Added `fromHex`, `lighten`, `darken`, and `isDark` helper methods. +- Expanded core extension libraries (`String`, `Iterable`, `DateTime`, `Duration`, `bool`, `BuildContext`) to include new highly-requested utilities: + - **String**: Added helpers like `toIntOrNull()`, `isNumeric`, `isValidEmail`, `toSlug()`, and `NullableStringExtensions` on `String?` (e.g., `isNullOrEmpty`). + - **Iterable**: Added functional utilities `chunked`, `groupBy`, `sortedBy`, and numeric aggregates (`sum`, `average`). + - **DateTime**: Added boundary generators like `startOfDay`, `endOfMonth`, and `startOfWeek`. + - **Context**: Mapped the complete Material 3 `ColorScheme` properties (e.g., `onPrimary`, `surfaceContainer`) directly to `BuildContext` for agile theming. ## 0.7.4 - Update packages diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc index 38dd0bc..d0e7f79 100644 --- a/example/linux/flutter/generated_plugin_registrant.cc +++ b/example/linux/flutter/generated_plugin_registrant.cc @@ -7,13 +7,9 @@ #include "generated_plugin_registrant.h" #include -#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); - g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); - url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index 65240e9..b29e9ba 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_secure_storage_linux - url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index 49858b0..66f641b 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,12 +7,10 @@ import Foundation import flutter_secure_storage_darwin import path_provider_foundation -import share_plus import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/example/pubspec.lock b/example/pubspec.lock index 81304ae..6393fb5 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -49,22 +49,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" - cross_file: - dependency: transitive - description: - name: cross_file - sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" - url: "https://pub.dev" - source: hosted - version: "0.3.4+2" - crypto: - dependency: transitive - description: - name: crypto - sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" - url: "https://pub.dev" - source: hosted - version: "3.0.6" cupertino_icons: dependency: "direct main" description: @@ -77,10 +61,10 @@ packages: dependency: transitive description: name: equatable - sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.8" fake_async: dependency: transitive description: @@ -105,14 +89,6 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" - fixnum: - dependency: transitive - description: - name: fixnum - sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be - url: "https://pub.dev" - source: hosted - version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -122,10 +98,10 @@ packages: dependency: transitive description: name: flutter_dotenv - sha256: b7c7be5cd9f6ef7a78429cabd2774d3c4af50e79cb2b7593e3d5d763ef95c61b + sha256: d4130c4a43e0b13fefc593bc3961f2cb46e30cb79e253d4a526b1b5d24ae1ce4 url: "https://pub.dev" source: hosted - version: "5.2.1" + version: "6.0.0" flutter_lints: dependency: "direct dev" description: @@ -138,26 +114,26 @@ packages: dependency: transitive description: name: flutter_secure_storage - sha256: f7eceb0bc6f4fd0441e29d43cab9ac2a1c5ffd7ea7b64075136b718c46954874 + sha256: da922f2aab2d733db7e011a6bcc4a825b844892d4edd6df83ff156b09a9b2e40 url: "https://pub.dev" source: hosted - version: "10.0.0-beta.4" + version: "10.0.0" flutter_secure_storage_darwin: dependency: transitive description: name: flutter_secure_storage_darwin - sha256: f226f2a572bed96bc6542198ebaec227150786e34311d455a7e2d3d06d951845 + sha256: "8878c25136a79def1668c75985e8e193d9d7d095453ec28730da0315dc69aee3" url: "https://pub.dev" source: hosted - version: "0.1.0" + version: "0.2.0" flutter_secure_storage_linux: dependency: transitive description: name: flutter_secure_storage_linux - sha256: "9b4b73127e857cd3117d43a70fa3dddadb6e0b253be62e6a6ab85caa0742182c" + sha256: "2b5c76dce569ab752d55a1cee6a2242bcc11fdba927078fb88c503f150767cda" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.0" flutter_secure_storage_platform_interface: dependency: transitive description: @@ -170,18 +146,18 @@ packages: dependency: transitive description: name: flutter_secure_storage_web - sha256: "4c3f233e739545c6cb09286eeec1cc4744138372b985113acc904f7263bef517" + sha256: "6a1137df62b84b54261dca582c1c09ea72f4f9a4b2fcee21b025964132d5d0c3" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: ff32af20f70a8d0e59b2938fc92de35b54a74671041c814275afd80e27df9f21 + sha256: "3b7c8e068875dfd46719ff57c90d8c459c87f2302ed6b00ff006b3c9fcad1613" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.1.0" flutter_test: dependency: "direct dev" description: flutter @@ -196,42 +172,34 @@ packages: dependency: transitive description: name: get_it - sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 - url: "https://pub.dev" - source: hosted - version: "8.0.3" - group_button: - dependency: transitive - description: - name: group_button - sha256: "0610fcf28ed122bfb4b410fce161a390f7f2531d55d1d65c5375982001415940" + sha256: "568d62f0e68666fb5d95519743b3c24a34c7f19d834b0658c46e26d778461f66" url: "https://pub.dev" source: hosted - version: "5.3.4" + version: "9.2.1" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -260,18 +228,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" - mime: - dependency: transitive - description: - name: mime - sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.dev" - source: hosted - version: "2.0.0" + version: "1.17.0" path: dependency: transitive description: @@ -342,7 +302,7 @@ packages: path: ".." relative: true source: path - version: "1.0.0-beta.4" + version: "1.0.0" plugin_platform_interface: dependency: transitive description: @@ -351,30 +311,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.7" - share_plus: - dependency: transitive - description: - name: share_plus - sha256: b2961506569e28948d75ec346c28775bb111986bb69dc6a20754a457e3d97fa0 - url: "https://pub.dev" - source: hosted - version: "11.0.0" - share_plus_platform_interface: - dependency: transitive - description: - name: share_plus_platform_interface - sha256: "1032d392bc5d2095a77447a805aa3f804d2ae6a4d5eef5e6ebb3bd94c1bc19ef" - url: "https://pub.dev" - source: hosted - version: "6.0.0" shared_preferences: dependency: transitive description: name: shared_preferences - sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.5.5" shared_preferences_android: dependency: transitive description: @@ -468,30 +412,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.1" - talker: - dependency: transitive - description: - name: talker - sha256: cf02a0d294701c76022f32bc8eb7e6f943953eb17fa1f8aaee56af210848134b - url: "https://pub.dev" - source: hosted - version: "4.9.1" - talker_flutter: - dependency: transitive - description: - name: talker_flutter - sha256: "9573cca369b964c8a8d34f422b74d4b934ac64341dd31560352fe458ba6b7894" - url: "https://pub.dev" - source: hosted - version: "4.9.1" talker_logger: dependency: transitive description: name: talker_logger - sha256: f1755d517e5ca8b119b65ad2fc1079746a8d03bd565e75d6b9d5aedf5c1d5b15 + sha256: cea1b8283a28c2118a0b197057fc5beb5b0672c75e40a48725e5e452c0278ff3 url: "https://pub.dev" source: hosted - version: "4.9.1" + version: "5.1.16" term_glyph: dependency: transitive description: @@ -504,66 +432,18 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.4" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.dev" - source: hosted - version: "1.4.0" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://pub.dev" - source: hosted - version: "2.3.2" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" - url: "https://pub.dev" - source: hosted - version: "3.1.4" - uuid: - dependency: transitive - description: - name: uuid - sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff - url: "https://pub.dev" - source: hosted - version: "4.5.1" + version: "0.7.7" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -592,10 +472,10 @@ packages: dependency: transitive description: name: worker_manager - sha256: af3db5e6c6c8a74ab8f72e25e9d305f8ff60984ca55551397e3c8828ebf30509 + sha256: "1bce9f894a0c187856f5fc0e150e7fe1facce326f048ca6172947754dac3d4f3" url: "https://pub.dev" source: hosted - version: "7.2.6" + version: "7.2.7" xdg_directories: dependency: transitive description: @@ -605,5 +485,5 @@ packages: source: hosted version: "1.0.3" sdks: - dart: ">=3.7.0-0 <4.0.0" - flutter: ">=3.27.0" + dart: ">=3.9.0 <4.0.0" + flutter: ">=3.35.0" diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index be05421..0c50753 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -7,14 +7,8 @@ #include "generated_plugin_registrant.h" #include -#include -#include void RegisterPlugins(flutter::PluginRegistry* registry) { FlutterSecureStorageWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); - SharePlusWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 7b6e42f..4fc759c 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -4,8 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_secure_storage_windows - share_plus - url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart new file mode 100644 index 0000000..79cb242 --- /dev/null +++ b/lib/generated/assets.dart @@ -0,0 +1,94 @@ +///This file is automatically generated. DO NOT EDIT, all your changes would be lost. +// ignore_for_file: dangling_library_doc_comments, implementation_imports +import 'package:flutter/widgets.dart'; + +class Assets { + Assets._(); +} + +class AssetGenImage { + const AssetGenImage(this._assetName, {this.size, this.flavors = const {}}); + + final String _assetName; + + final Size? size; + final Set flavors; + + Image image({ + Key? key, + AssetBundle? bundle, + ImageFrameBuilder? frameBuilder, + ImageErrorWidgetBuilder? errorBuilder, + String? semanticLabel, + bool excludeFromSemantics = false, + double? scale, + double? width, + double? height, + Color? color, + Animation? opacity, + BlendMode? colorBlendMode, + BoxFit? fit, + AlignmentGeometry alignment = Alignment.center, + ImageRepeat repeat = ImageRepeat.noRepeat, + Rect? centerSlice, + bool matchTextDirection = false, + bool gaplessPlayback = false, + bool isAntiAlias = false, + String? package, + FilterQuality filterQuality = FilterQuality.low, + int? cacheWidth, + int? cacheHeight, + }) { + return Image.asset( + _assetName, + key: key, + bundle: bundle, + frameBuilder: frameBuilder, + errorBuilder: errorBuilder, + semanticLabel: semanticLabel, + excludeFromSemantics: excludeFromSemantics, + scale: scale, + width: width, + height: height, + color: color, + opacity: opacity, + colorBlendMode: colorBlendMode, + fit: fit, + alignment: alignment, + repeat: repeat, + centerSlice: centerSlice, + matchTextDirection: matchTextDirection, + gaplessPlayback: gaplessPlayback, + isAntiAlias: isAntiAlias, + package: package, + filterQuality: filterQuality, + cacheWidth: cacheWidth, + cacheHeight: cacheHeight, + ); + } + + ImageProvider provider({ + AssetBundle? bundle, + String? package, + }) { + return AssetImage( + _assetName, + bundle: bundle, + package: package, + ); + } + + Widget custom({ + Key? key, + required Widget Function(BuildContext context, String assetPath) builder, + }) { + return Builder( + key: key, + builder: (context) => builder(context, _assetName), + ); + } + + String get path => _assetName; + + String get keyName => _assetName; +} diff --git a/lib/src/extensions/bool_extensions.dart b/lib/src/extensions/bool_extensions.dart index 67191f6..66b6085 100644 --- a/lib/src/extensions/bool_extensions.dart +++ b/lib/src/extensions/bool_extensions.dart @@ -6,3 +6,12 @@ extension BoolExtensions on bool { /// Reverse the value of bool bool toggle() => !this; } + +/// Extensions for nullable booleans. +extension NullableBoolExtensions on bool? { + /// Returns `true` only if the value is explicitly `true`. + bool get isTrue => this == true; + + /// Returns `true` only if the value is explicitly `false`. + bool get isFalse => this == false; +} diff --git a/lib/src/extensions/color_extensions.dart b/lib/src/extensions/color_extensions.dart index 541586b..515c2e3 100644 --- a/lib/src/extensions/color_extensions.dart +++ b/lib/src/extensions/color_extensions.dart @@ -1,31 +1,69 @@ -import 'dart:ui'; +import 'package:flutter/painting.dart'; extension PlayxColorExtensions on Color { /// Returns the color as a hex string with an optional leading hash sign. String toHex({bool leadingHashSign = true, bool includeAlpha = false}) { final buffer = StringBuffer(); if (leadingHashSign) buffer.write('#'); + + final aInt = (a * 255).round(); + final rInt = (r * 255).round(); + final gInt = (g * 255).round(); + final bInt = (b * 255).round(); + if (includeAlpha) { - buffer.write(alpha.toRadixString(16).padLeft(2, '0')); + buffer.write(aInt.toRadixString(16).padLeft(2, '0')); } - buffer.write(red.toRadixString(16).padLeft(2, '0')); - buffer.write(green.toRadixString(16).padLeft(2, '0')); - buffer.write(blue.toRadixString(16).padLeft(2, '0')); + buffer.write(rInt.toRadixString(16).padLeft(2, '0')); + buffer.write(gInt.toRadixString(16).padLeft(2, '0')); + buffer.write(bInt.toRadixString(16).padLeft(2, '0')); return buffer.toString(); } + /// Creates a [Color] from a hex string (e.g., '#RRGGBB' or 'RRGGBBAA'). + static Color fromHex(String hexString) { + final buffer = StringBuffer(); + if (hexString.length == 6 || hexString.length == 7) buffer.write('ff'); + buffer.write(hexString.replaceFirst('#', '')); + return Color(int.parse(buffer.toString(), radix: 16)); + } + /// Returns a new color object by updating the alpha, red, green, or blue value of the current color. + /// Uses [double] values from 0.0 to 1.0. Color copyWith({ double? alpha, double? red, double? green, double? blue, }) { - return Color.fromRGBO( - red != null ? (red * 255).toInt() : this.red, - green != null ? (green * 255).toInt() : this.green, - blue != null ? (blue * 255).toInt() : this.blue, - alpha ?? (this.alpha / 255), + return withValues( + alpha: alpha, + red: red, + green: green, + blue: blue, ); } + + /// Lightens the color by a given [amount] (0.0 to 1.0). + Color lighten([double amount = .1]) { + assert(amount >= 0 && amount <= 1); + final hsl = HSLColor.fromColor(this); + final hslLight = hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0)); + return hslLight.toColor(); + } + + /// Darkens the color by a given [amount] (0.0 to 1.0). + Color darken([double amount = .1]) { + assert(amount >= 0 && amount <= 1); + final hsl = HSLColor.fromColor(this); + final hslDark = hsl.withLightness((hsl.lightness - amount).clamp(0.0, 1.0)); + return hslDark.toColor(); + } + + /// Computes whether this color is considered dark, useful for dynamically picking text color overlay. + bool get isDark { + // Standard relative luminance check + final relativeLuminance = computeLuminance(); + return relativeLuminance < 0.5; + } } diff --git a/lib/src/extensions/context/colors.dart b/lib/src/extensions/context/colors.dart index 29a70c3..3975945 100644 --- a/lib/src/extensions/context/colors.dart +++ b/lib/src/extensions/context/colors.dart @@ -61,4 +61,36 @@ extension ContextColorsExtensions on BuildContext { /// shortcut for `Theme.of(context).colorScheme.primary` Color get buttonPrimaryColor => colorScheme.primary; + + /// * Material 3 ColorScheme shortcuts + + Color get primary => colorScheme.primary; + Color get onPrimary => colorScheme.onPrimary; + Color get primaryContainer => colorScheme.primaryContainer; + Color get onPrimaryContainer => colorScheme.onPrimaryContainer; + + Color get onSecondary => colorScheme.onSecondary; + Color get secondaryContainer => colorScheme.secondaryContainer; + Color get onSecondaryContainer => colorScheme.onSecondaryContainer; + + Color get tertiary => colorScheme.tertiary; + Color get onTertiary => colorScheme.onTertiary; + Color get tertiaryContainer => colorScheme.tertiaryContainer; + Color get onTertiaryContainer => colorScheme.onTertiaryContainer; + + Color get surface => colorScheme.surface; + Color get onSurface => colorScheme.onSurface; + + Color get error => colorScheme.error; + Color get onError => colorScheme.onError; + Color get errorContainer => colorScheme.errorContainer; + Color get onErrorContainer => colorScheme.onErrorContainer; + + Color get outline => colorScheme.outline; + Color get outlineVariant => colorScheme.outlineVariant; + Color get shadow => colorScheme.shadow; + Color get scrim => colorScheme.scrim; + Color get inverseSurface => colorScheme.inverseSurface; + Color get onInverseSurface => colorScheme.onInverseSurface; + Color get inversePrimary => colorScheme.inversePrimary; } diff --git a/lib/src/extensions/date_time_extensions.dart b/lib/src/extensions/date_time_extensions.dart index 638a254..d53e673 100644 --- a/lib/src/extensions/date_time_extensions.dart +++ b/lib/src/extensions/date_time_extensions.dart @@ -162,4 +162,29 @@ extension DateTimeExtensions on DateTime { second ?? this.second, millisecond ?? this.millisecond, ); + + /// Returns a new [DateTime] with the time set to the start of the day (00:00:00.000). + /// This is functionally equivalent to [withoutTime]. + DateTime get startOfDay => DateTime(year, month, day); + + /// Returns a new [DateTime] with the time set to the end of the day (23:59:59.999). + DateTime get endOfDay => DateTime(year, month, day, 23, 59, 59, 999); + + /// Returns a new [DateTime] with the time set to the start of the month. + DateTime get startOfMonth => DateTime(year, month, 1); + + /// Returns a new [DateTime] with the time set to the end of the month. + DateTime get endOfMonth => DateTime(year, month + 1, 0, 23, 59, 59, 999); + + /// Returns a new [DateTime] with the time set to the start of the week. + DateTime startOfWeek({Weekday firstDay = Weekday.monday}) { + final int dayOfWeek = dayOfTheWeekIndex(firstDay: firstDay); + return subtract(Duration(days: dayOfWeek)).startOfDay; + } + + /// Returns a new [DateTime] with the time set to the end of the week. + DateTime endOfWeek({Weekday firstDay = Weekday.monday}) { + final int dayOfWeek = dayOfTheWeekIndex(firstDay: firstDay); + return add(Duration(days: 6 - dayOfWeek)).endOfDay; + } } diff --git a/lib/src/extensions/duration_extensions.dart b/lib/src/extensions/duration_extensions.dart index db1fdef..b3ec6a1 100644 --- a/lib/src/extensions/duration_extensions.dart +++ b/lib/src/extensions/duration_extensions.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + String twoDigits(int n) => n.toString().padLeft(2, "0"); /// Extension functions to convert duration to formatted hours, minutes, seconds and milliseconds. @@ -130,4 +132,9 @@ extension DurationExtensions on Duration { } return buffer.toString(); } + + /// Delays the execution of the given [callback] by this duration. + /// If [callback] is omitted, simply delays for this duration. + Future delay([FutureOr Function()? callback]) => + Future.delayed(this, callback); } diff --git a/lib/src/extensions/iterable_extensions.dart b/lib/src/extensions/iterable_extensions.dart index b88c040..8b11024 100644 --- a/lib/src/extensions/iterable_extensions.dart +++ b/lib/src/extensions/iterable_extensions.dart @@ -115,6 +115,48 @@ extension PlayxIterableExtensions on Iterable { } return result; } + + /// Splits this iterable into lists of the given [size]. + List> chunked(int size) { + if (size <= 0) { + throw ArgumentError('Size must be greater than 0'); + } + final result = >[]; + final iterator = this.iterator; + while (iterator.moveNext()) { + final chunk = [iterator.current]; + for (int i = 1; i < size && iterator.moveNext(); i++) { + chunk.add(iterator.current); + } + result.add(chunk); + } + return result; + } + + /// Groups elements by the key returned by the [keySelector] function. + Map> groupBy(K Function(T) keySelector) { + final result = >{}; + for (final element in this) { + final key = keySelector(element); + result.putIfAbsent(key, () => []).add(element); + } + return result; + } + + /// Returns a new list sorted by the key returned by the [keySelector] function. + List sortedBy>(K Function(T) keySelector) { + final list = List.of(this); + list.sort((a, b) => keySelector(a).compareTo(keySelector(b))); + return list; + } + + /// Returns a new list sorted in descending order by the key returned by the [keySelector] function. + List sortedByDescending>( + K Function(T) keySelector) { + final list = List.of(this); + list.sort((a, b) => keySelector(b).compareTo(keySelector(a))); + return list; + } } extension NestedIterablesExtensions on Iterable> { @@ -140,3 +182,18 @@ extension NestedIterablesExtensions on Iterable> { mapper: mapper, ); } + +/// Extensions for [Iterable]s of numbers. +extension PlayxIterableNumExtensions on Iterable { + /// Returns the sum of all elements in the collection. + num get sum { + if (isEmpty) return 0; + return fold(0, (previousValue, element) => previousValue + element); + } + + /// Returns the average of all elements in the collection. + double get average { + if (isEmpty) return 0; + return sum / length; + } +} diff --git a/lib/src/extensions/string_extensions.dart b/lib/src/extensions/string_extensions.dart index 5ccaf61..b7f3906 100644 --- a/lib/src/extensions/string_extensions.dart +++ b/lib/src/extensions/string_extensions.dart @@ -78,4 +78,59 @@ extension StringExtensions on String { /// Returns first symbol of string or null string if it's empty String? get firstOrNull => isEmpty ? null : this[0]; + + /// Parses the string to an [int] or returns null if it cannot be parsed. + int? toIntOrNull() => int.tryParse(this); + + /// Parses the string to a [double] or returns null if it cannot be parsed. + double? toDoubleOrNull() => double.tryParse(this); + + /// Checks if the string represents a valid numeric value (int or double). + bool get isNumeric => num.tryParse(this) != null; + + /// Returns true if this string contains [other] while ignoring case. + bool containsIgnoreCase(String other) => + toLowerCase().contains(other.toLowerCase()); + + /// Returns true if this string is equal to [other] while ignoring case. + bool equalsIgnoreCase(String other) => toLowerCase() == other.toLowerCase(); + + /// Removes all whitespace characters from the string. + String removeWhitespace() => replaceAll(RegExp(r'\s+'), ''); + + /// Converts the string to a URL-friendly slug. + String toSlug() => toLowerCase() + .replaceAll(RegExp(r'[^a-z0-9]+'), '-') + .replaceAll(RegExp(r'^-+|-+$'), ''); + + /// Removes basic HTML tags from the string. + String removeHtmlTags() => replaceAll(RegExp(r'<[^>]*>'), ''); + + /// Checks if the string is a valid email address. + bool get isValidEmail => RegExp( + r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+") + .hasMatch(this); + + /// Checks if the string is a valid URL. + bool get isValidUrl => RegExp( + r"^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-\.\/?\%&=]*)?$") + .hasMatch(this); + + /// Truncates the string if its length exceeds [maxLength], appending the [suffix]. + String limit(int maxLength, {String suffix = '...'}) { + if (length <= maxLength) return this; + return '${substring(0, maxLength)}$suffix'; + } +} + +/// Extension functions on a nullable String. +extension NullableStringExtensions on String? { + /// Checks if the string is null or empty. + bool get isNullOrEmpty => this == null || this!.isEmpty; + + /// Checks if the string is not null and not empty. + bool get isNotNullOrEmpty => this != null && this!.isNotEmpty; + + /// Returns this string if it's not null or empty; otherwise, returns the [fallback] value. + String ifNullOrEmpty(String fallback) => isNullOrEmpty ? fallback : this!; } diff --git a/lib/src/logger/playx_logger.dart b/lib/src/logger/playx_logger.dart index d64b803..b1d4c36 100644 --- a/lib/src/logger/playx_logger.dart +++ b/lib/src/logger/playx_logger.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:talker_logger/talker_logger.dart'; import 'talker_playx_logger.dart'; import 'playx_logger_settings.dart'; @@ -8,6 +9,8 @@ class DefaultColoredLoggerFormatter implements LoggerFormatter { @override String fmt(LogDetails details, TalkerLoggerSettings settings) { final msg = details.message?.toString() ?? ''; + if (!settings.enableColors || kIsWeb) return msg; + final coloredMsg = msg.split('\n').map((e) => details.pen.write(e)).toList().join('\n'); return coloredMsg; diff --git a/lib/src/logger/playx_logger_settings.dart b/lib/src/logger/playx_logger_settings.dart index fcfb3d6..9dca884 100644 --- a/lib/src/logger/playx_logger_settings.dart +++ b/lib/src/logger/playx_logger_settings.dart @@ -63,7 +63,7 @@ class PlayxLoggerSettings { PlayxLoggerSettings({ this.enabled = kDebugMode, this.useColors = true, - this.printToConsole = true, + this.printToConsole = kDebugMode, this.printLoggerName = true, this.printDateTime = false, this.level = LogLevel.verbose, diff --git a/lib/src/logger/talker_playx_logger.dart b/lib/src/logger/talker_playx_logger.dart index 6f5ed96..eb6fdf7 100644 --- a/lib/src/logger/talker_playx_logger.dart +++ b/lib/src/logger/talker_playx_logger.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:talker_logger/talker_logger.dart'; import 'base_logger.dart'; @@ -12,25 +13,30 @@ class TalkerPlayxLogger extends PlayxBaseLogger { settings: TalkerLoggerSettings( colors: settings.colors, enable: settings.enabled, - defaultTitle: name ?? 'PLay Logger', + defaultTitle: name ?? 'Playx Logger', level: settings.level, lineSymbol: settings.lineSymbol, maxLineWidth: settings.maxLineWidth, - enableColors: settings.useColors, + enableColors: kIsWeb ? false : settings.useColors, ), formatter: settings.formatter, - output: settings.output, + output: settings.printToConsole + ? settings.output ?? ((String message) => debugPrint(message)) + : ((String message) {}), filter: settings.filter, ); String _formatMessage(dynamic message, {String? tag}) { - final tagPart = tag != null ? '[$tag]' : ''; - final namePart = name != null ? '[$name]' : ''; - return '$namePart$tagPart $message'; + final StringBuffer buffer = StringBuffer(); + if (name != null) buffer.write('[$name] '); + if (tag != null) buffer.write('[$tag] '); + buffer.write(message?.toString() ?? 'null'); + return buffer.toString(); } @override void critical(message, {String? tag}) { + if (!settings.enabled) return; _talker.critical( _formatMessage(message, tag: tag), ); @@ -38,6 +44,7 @@ class TalkerPlayxLogger extends PlayxBaseLogger { @override void debug(message, {String? tag}) { + if (!settings.enabled) return; _talker.debug( _formatMessage(message, tag: tag), ); @@ -45,6 +52,7 @@ class TalkerPlayxLogger extends PlayxBaseLogger { @override void error(message, {Object? error, StackTrace? stackTrace, String? tag}) { + if (!settings.enabled) return; final formattedMessage = _formatMessage(message, tag: tag); final messageWithError = error != null ? '$formattedMessage\n$error' : formattedMessage; @@ -56,6 +64,7 @@ class TalkerPlayxLogger extends PlayxBaseLogger { @override void info(message, {String? tag}) { + if (!settings.enabled) return; _talker.info( _formatMessage(message, tag: tag), ); @@ -63,6 +72,7 @@ class TalkerPlayxLogger extends PlayxBaseLogger { @override void log(message, {String? tag}) { + if (!settings.enabled) return; _talker.log( _formatMessage(message, tag: tag), ); @@ -70,6 +80,7 @@ class TalkerPlayxLogger extends PlayxBaseLogger { @override void warning(message, {String? tag}) { + if (!settings.enabled) return; _talker.warning( _formatMessage(message, tag: tag), ); @@ -77,6 +88,7 @@ class TalkerPlayxLogger extends PlayxBaseLogger { @override void verbose(message, {String? tag}) { + if (!settings.enabled) return; _talker.verbose( _formatMessage(message, tag: tag), ); diff --git a/lib/src/utils/mapper_utilities.dart b/lib/src/utils/mapper_utilities.dart index e138df3..31eda5f 100644 --- a/lib/src/utils/mapper_utilities.dart +++ b/lib/src/utils/mapper_utilities.dart @@ -24,7 +24,7 @@ class MapUtils { required Mapper mapper, bool printError = kDebugMode}) async { try { - return mapper(data); + return await mapper(data); } catch (e, s) { if (printError) { PlayxCore.logger.error('MapAsync Error', error: e, stackTrace: s); diff --git a/lib/src/utils/safe_convert.dart b/lib/src/utils/safe_convert.dart index f80ee15..34c9496 100644 --- a/lib/src/utils/safe_convert.dart +++ b/lib/src/utils/safe_convert.dart @@ -189,6 +189,14 @@ List? toListOrNull(dynamic value, {T Function(dynamic json)? fromJson}) { log('ERROR in converting list', error: e, stackTrace: s); } } + } else if (value is List) { + try { + return List.from(value); + } catch (e, s) { + if (kDebugMode) { + log('ERROR in casting list', error: e, stackTrace: s); + } + } } return null; } @@ -203,6 +211,51 @@ List toList(dynamic value, {T Function(dynamic json)? fromJson}) => toListOrNull(value, fromJson: fromJson) ?? (throw FormatException('Invalid List<$T> value: $value')); +// --------------------- ENUM --------------------- + +/// Safely converts [value] to an enum of type [T], or returns null if conversion fails. +/// Requires the list of all enum [values] (e.g., MyEnum.values). +T? toEnumOrNull(dynamic value, List values) { + if (value == null) return null; + if (value is T) return value; + final stringValue = toStringOrNull(value)?.toLowerCase(); + if (stringValue == null) return null; + try { + return values.firstWhere( + (e) => e.name.toLowerCase() == stringValue, + ); + } catch (_) { + return null; + } +} + +/// Converts [value] to an enum or returns [fallback] if conversion fails. +T toEnumOr(dynamic value, List values, {required T fallback}) => + toEnumOrNull(value, values) ?? fallback; + +/// Converts [value] to an enum or throws [FormatException] if conversion fails. +T toEnum(dynamic value, List values) => + toEnumOrNull(value, values) ?? (throw FormatException('Invalid enum value: $value')); + +// --------------------- URI --------------------- + +/// Safely converts [value] to [Uri], or returns null if conversion fails. +Uri? toUriOrNull(dynamic value) { + if (value == null) return null; + if (value is Uri) return value; + final stringValue = toStringOrNull(value); + if (stringValue == null) return null; + return Uri.tryParse(stringValue); +} + +/// Converts [value] to [Uri] or returns [fallback] if conversion fails. +Uri toUriOr(dynamic value, {required Uri fallback}) => + toUriOrNull(value) ?? fallback; + +/// Converts [value] to [Uri] or throws [FormatException] if conversion fails. +Uri toUri(dynamic value) => + toUriOrNull(value) ?? (throw FormatException('Invalid Uri value: $value')); + // --------------------- GENERIC --------------------- /// Safely converts [value] to type [T] using the [fromJson] function, or returns null if conversion fails. diff --git a/lib/src/utils/safe_json_convert.dart b/lib/src/utils/safe_json_convert.dart index 9ff9468..385ef33 100644 --- a/lib/src/utils/safe_json_convert.dart +++ b/lib/src/utils/safe_json_convert.dart @@ -2,11 +2,36 @@ import 'package:playx_core/src/utils/safe_convert.dart'; /// Internal helper to safely get a value from a JSON map by key. /// Returns null if the JSON is null, not a map, or if the key is missing. +/// Supports dot-notation for nested keys (e.g., 'data.user.name' or 'data.users.0.name'). dynamic _getJsonValueOrNull(dynamic json, String key) { - if (json == null || json is! Map || !json.containsKey(key)) { + if (json == null) { return null; } - return json[key]; + + if (json is Map && json.containsKey(key)) { + return json[key]; + } + + if (key.contains('.')) { + final keys = key.split('.'); + dynamic current = json; + + for (final k in keys) { + if (current is Map) { + if (!current.containsKey(k)) return null; + current = current[k]; + } else if (current is List) { + final index = int.tryParse(k); + if (index == null || index < 0 || index >= current.length) return null; + current = current[index]; + } else { + return null; + } + } + return current; + } + + return null; } /// ==================== @@ -168,6 +193,53 @@ DateTime asLocalDateTimeOr(dynamic json, String key, return toLocalDateTimeOr(value, fallback: fallback); } +/// ==================== +/// Enum conversions +/// ==================== + +/// Returns an enum if the value at [key] can be matched, otherwise null. +T? asEnumOrNull(dynamic json, String key, List values) { + final value = _getJsonValueOrNull(json, key); + return toEnumOrNull(value, values); +} + +/// Returns an enum for the value at [key]. +/// Throws a [FormatException] if the value cannot be matched. +T asEnum(dynamic json, String key, List values) { + final value = _getJsonValueOrNull(json, key); + return toEnum(value, values); +} + +/// Returns an enum for the value at [key], or [fallback] if parsing fails. +T asEnumOr(dynamic json, String key, List values, + {required T fallback}) { + final value = _getJsonValueOrNull(json, key); + return toEnumOr(value, values, fallback: fallback); +} + +/// ==================== +/// Uri conversions +/// ==================== + +/// Returns an Uri if the value at [key] can be parsed, otherwise null. +Uri? asUriOrNull(dynamic json, String key) { + final value = _getJsonValueOrNull(json, key); + return toUriOrNull(value); +} + +/// Returns an Uri for the value at [key]. +/// Throws a [FormatException] if the value cannot be parsed. +Uri asUri(dynamic json, String key) { + final value = _getJsonValueOrNull(json, key); + return toUri(value); +} + +/// Returns an Uri for the value at [key], or [fallback] if parsing fails. +Uri asUriOr(dynamic json, String key, {required Uri fallback}) { + final value = _getJsonValueOrNull(json, key); + return toUriOr(value, fallback: fallback); +} + /// ==================== /// Map conversions /// ==================== @@ -299,6 +371,7 @@ T? asTOrNull(dynamic json, String key, if ([] is T) return toListOrNull(value) as T?; if ({} is T) return toMapOrNull(value) as T?; if (DateTime.now() is T) return toDateTimeOrNull(value) as T?; + if (Uri.parse('') is T) return toUriOrNull(value) as T?; } catch (_) { return null; } diff --git a/pubspec.lock b/pubspec.lock index 5df964f..cd52f38 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -49,30 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" - cross_file: - dependency: transitive - description: - name: cross_file - sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" - url: "https://pub.dev" - source: hosted - version: "0.3.4+2" - crypto: - dependency: transitive - description: - name: crypto - sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" - url: "https://pub.dev" - source: hosted - version: "3.0.6" equatable: dependency: "direct main" description: name: equatable - sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" + sha256: "3e0141505477fd8ad55d6eb4e7776d3fe8430be8e497ccb1521370c3f21a3e2b" url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.8" fake_async: dependency: transitive description: @@ -97,14 +81,6 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" - fixnum: - dependency: transitive - description: - name: fixnum - sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be - url: "https://pub.dev" - source: hosted - version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -114,10 +90,10 @@ packages: dependency: "direct main" description: name: flutter_dotenv - sha256: b7c7be5cd9f6ef7a78429cabd2774d3c4af50e79cb2b7593e3d5d763ef95c61b + sha256: d4130c4a43e0b13fefc593bc3961f2cb46e30cb79e253d4a526b1b5d24ae1ce4 url: "https://pub.dev" source: hosted - version: "5.2.1" + version: "6.0.0" flutter_lints: dependency: "direct dev" description: @@ -130,26 +106,26 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: f7eceb0bc6f4fd0441e29d43cab9ac2a1c5ffd7ea7b64075136b718c46954874 + sha256: da922f2aab2d733db7e011a6bcc4a825b844892d4edd6df83ff156b09a9b2e40 url: "https://pub.dev" source: hosted - version: "10.0.0-beta.4" + version: "10.0.0" flutter_secure_storage_darwin: dependency: transitive description: name: flutter_secure_storage_darwin - sha256: f226f2a572bed96bc6542198ebaec227150786e34311d455a7e2d3d06d951845 + sha256: "8878c25136a79def1668c75985e8e193d9d7d095453ec28730da0315dc69aee3" url: "https://pub.dev" source: hosted - version: "0.1.0" + version: "0.2.0" flutter_secure_storage_linux: dependency: transitive description: name: flutter_secure_storage_linux - sha256: "9b4b73127e857cd3117d43a70fa3dddadb6e0b253be62e6a6ab85caa0742182c" + sha256: "2b5c76dce569ab752d55a1cee6a2242bcc11fdba927078fb88c503f150767cda" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.0" flutter_secure_storage_platform_interface: dependency: transitive description: @@ -162,18 +138,18 @@ packages: dependency: transitive description: name: flutter_secure_storage_web - sha256: "4c3f233e739545c6cb09286eeec1cc4744138372b985113acc904f7263bef517" + sha256: "6a1137df62b84b54261dca582c1c09ea72f4f9a4b2fcee21b025964132d5d0c3" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: ff32af20f70a8d0e59b2938fc92de35b54a74671041c814275afd80e27df9f21 + sha256: "3b7c8e068875dfd46719ff57c90d8c459c87f2302ed6b00ff006b3c9fcad1613" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.1.0" flutter_test: dependency: "direct dev" description: flutter @@ -188,50 +164,42 @@ packages: dependency: "direct main" description: name: get_it - sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103 - url: "https://pub.dev" - source: hosted - version: "8.0.3" - group_button: - dependency: transitive - description: - name: group_button - sha256: "0610fcf28ed122bfb4b410fce161a390f7f2531d55d1d65c5375982001415940" + sha256: "568d62f0e68666fb5d95519743b3c24a34c7f19d834b0658c46e26d778461f66" url: "https://pub.dev" source: hosted - version: "5.3.4" + version: "9.2.1" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: "direct dev" description: name: lints - sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "6.1.0" matcher: dependency: transitive description: @@ -252,18 +220,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" - mime: - dependency: transitive - description: - name: mime - sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.dev" - source: hosted - version: "2.0.0" + version: "1.17.0" path: dependency: transitive description: @@ -336,30 +296,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" - share_plus: - dependency: transitive - description: - name: share_plus - sha256: b2961506569e28948d75ec346c28775bb111986bb69dc6a20754a457e3d97fa0 - url: "https://pub.dev" - source: hosted - version: "11.0.0" - share_plus_platform_interface: - dependency: transitive - description: - name: share_plus_platform_interface - sha256: "1032d392bc5d2095a77447a805aa3f804d2ae6a4d5eef5e6ebb3bd94c1bc19ef" - url: "https://pub.dev" - source: hosted - version: "6.0.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf url: "https://pub.dev" source: hosted - version: "2.5.3" + version: "2.5.5" shared_preferences_android: dependency: transitive description: @@ -453,30 +397,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.1" - talker: - dependency: transitive - description: - name: talker - sha256: cf02a0d294701c76022f32bc8eb7e6f943953eb17fa1f8aaee56af210848134b - url: "https://pub.dev" - source: hosted - version: "4.9.1" - talker_flutter: - dependency: "direct main" - description: - name: talker_flutter - sha256: "9573cca369b964c8a8d34f422b74d4b934ac64341dd31560352fe458ba6b7894" - url: "https://pub.dev" - source: hosted - version: "4.9.1" talker_logger: dependency: "direct main" description: name: talker_logger - sha256: f1755d517e5ca8b119b65ad2fc1079746a8d03bd565e75d6b9d5aedf5c1d5b15 + sha256: cea1b8283a28c2118a0b197057fc5beb5b0672c75e40a48725e5e452c0278ff3 url: "https://pub.dev" source: hosted - version: "4.9.1" + version: "5.1.16" term_glyph: dependency: transitive description: @@ -489,66 +417,18 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd - url: "https://pub.dev" - source: hosted - version: "0.7.4" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.dev" - source: hosted - version: "1.4.0" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "2.3.2" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" - url: "https://pub.dev" - source: hosted - version: "3.1.4" - uuid: - dependency: transitive - description: - name: uuid - sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff - url: "https://pub.dev" - source: hosted - version: "4.5.1" + version: "0.7.7" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -577,10 +457,10 @@ packages: dependency: "direct main" description: name: worker_manager - sha256: af3db5e6c6c8a74ab8f72e25e9d305f8ff60984ca55551397e3c8828ebf30509 + sha256: "1bce9f894a0c187856f5fc0e150e7fe1facce326f048ca6172947754dac3d4f3" url: "https://pub.dev" source: hosted - version: "7.2.6" + version: "7.2.7" xdg_directories: dependency: transitive description: @@ -590,5 +470,5 @@ packages: source: hosted version: "1.1.0" sdks: - dart: ">=3.8.0 <4.0.0" - flutter: ">=3.27.0" + dart: ">=3.9.0 <4.0.0" + flutter: ">=3.35.0" diff --git a/pubspec.yaml b/pubspec.yaml index d0a1ee0..94a38af 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: playx_core description: Core package for playx eco system contains shared classes and utilities. -version: 1.0.0-beta.6 +version: 1.0.0 homepage: https://sourcya.io/ repository: https://github.com/playx-flutter/playx_core issue_tracker: https://github.com/playx-flutter/playx_core/issues @@ -18,18 +18,18 @@ environment: dependencies: flutter: sdk: flutter - shared_preferences: ^2.5.3 - equatable: ^2.0.7 + shared_preferences: ^2.5.5 + equatable: ^2.0.8 sprintf: ^7.0.0 - flutter_secure_storage: ^10.0.0-beta.4 + flutter_secure_storage: ^10.0.0 flutter_dotenv: ^6.0.0 - get_it: ^9.0.5 + get_it: ^9.2.1 worker_manager: ^7.2.7 - talker_logger: ^5.0.2 + talker_logger: ^5.1.16 web: ^1.1.1 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^6.0.0 - lints: ^6.0.0 + lints: ^6.1.0 diff --git a/test_color.dart b/test_color.dart new file mode 100644 index 0000000..22187a9 --- /dev/null +++ b/test_color.dart @@ -0,0 +1,10 @@ +import 'dart:ui'; + +void main() { + const c = Color(0xFF112233); + print(c.a); + print(c.r); + print(c.g); + print(c.b); + print(c.toARGB32().toRadixString(16)); +} From 5f78f723849845f8ecce879ba034f4b4a1e7b6ca Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 1 Apr 2026 15:05:41 +0200 Subject: [PATCH 17/17] refactor: code cleanup --- lib/src/extensions/color_extensions.dart | 5 +++-- lib/src/extensions/context/colors.dart | 2 +- lib/src/extensions/string_extensions.dart | 6 +++--- lib/src/logger/playx_logger.dart | 5 +++-- lib/src/utils/safe_convert.dart | 6 ++++-- lib/src/utils/safe_json_convert.dart | 2 +- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/src/extensions/color_extensions.dart b/lib/src/extensions/color_extensions.dart index 515c2e3..b224adb 100644 --- a/lib/src/extensions/color_extensions.dart +++ b/lib/src/extensions/color_extensions.dart @@ -5,7 +5,7 @@ extension PlayxColorExtensions on Color { String toHex({bool leadingHashSign = true, bool includeAlpha = false}) { final buffer = StringBuffer(); if (leadingHashSign) buffer.write('#'); - + final aInt = (a * 255).round(); final rInt = (r * 255).round(); final gInt = (g * 255).round(); @@ -48,7 +48,8 @@ extension PlayxColorExtensions on Color { Color lighten([double amount = .1]) { assert(amount >= 0 && amount <= 1); final hsl = HSLColor.fromColor(this); - final hslLight = hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0)); + final hslLight = + hsl.withLightness((hsl.lightness + amount).clamp(0.0, 1.0)); return hslLight.toColor(); } diff --git a/lib/src/extensions/context/colors.dart b/lib/src/extensions/context/colors.dart index 3975945..ccb44c2 100644 --- a/lib/src/extensions/context/colors.dart +++ b/lib/src/extensions/context/colors.dart @@ -63,7 +63,7 @@ extension ContextColorsExtensions on BuildContext { Color get buttonPrimaryColor => colorScheme.primary; /// * Material 3 ColorScheme shortcuts - + Color get primary => colorScheme.primary; Color get onPrimary => colorScheme.onPrimary; Color get primaryContainer => colorScheme.primaryContainer; diff --git a/lib/src/extensions/string_extensions.dart b/lib/src/extensions/string_extensions.dart index b7f3906..8588dee 100644 --- a/lib/src/extensions/string_extensions.dart +++ b/lib/src/extensions/string_extensions.dart @@ -112,9 +112,9 @@ extension StringExtensions on String { .hasMatch(this); /// Checks if the string is a valid URL. - bool get isValidUrl => RegExp( - r"^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-\.\/?\%&=]*)?$") - .hasMatch(this); + bool get isValidUrl => + RegExp(r"^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-\.\/?\%&=]*)?$") + .hasMatch(this); /// Truncates the string if its length exceeds [maxLength], appending the [suffix]. String limit(int maxLength, {String suffix = '...'}) { diff --git a/lib/src/logger/playx_logger.dart b/lib/src/logger/playx_logger.dart index b1d4c36..4c582bb 100644 --- a/lib/src/logger/playx_logger.dart +++ b/lib/src/logger/playx_logger.dart @@ -1,8 +1,9 @@ import 'package:flutter/foundation.dart'; import 'package:talker_logger/talker_logger.dart'; -import 'talker_playx_logger.dart'; -import 'playx_logger_settings.dart'; + import 'base_logger.dart'; +import 'playx_logger_settings.dart'; +import 'talker_playx_logger.dart'; /// A default logger formatter that uses colored output for log messages. class DefaultColoredLoggerFormatter implements LoggerFormatter { diff --git a/lib/src/utils/safe_convert.dart b/lib/src/utils/safe_convert.dart index 34c9496..b3f67fb 100644 --- a/lib/src/utils/safe_convert.dart +++ b/lib/src/utils/safe_convert.dart @@ -230,12 +230,14 @@ T? toEnumOrNull(dynamic value, List values) { } /// Converts [value] to an enum or returns [fallback] if conversion fails. -T toEnumOr(dynamic value, List values, {required T fallback}) => +T toEnumOr(dynamic value, List values, + {required T fallback}) => toEnumOrNull(value, values) ?? fallback; /// Converts [value] to an enum or throws [FormatException] if conversion fails. T toEnum(dynamic value, List values) => - toEnumOrNull(value, values) ?? (throw FormatException('Invalid enum value: $value')); + toEnumOrNull(value, values) ?? + (throw FormatException('Invalid enum value: $value')); // --------------------- URI --------------------- diff --git a/lib/src/utils/safe_json_convert.dart b/lib/src/utils/safe_json_convert.dart index 385ef33..1a1cf1b 100644 --- a/lib/src/utils/safe_json_convert.dart +++ b/lib/src/utils/safe_json_convert.dart @@ -15,7 +15,7 @@ dynamic _getJsonValueOrNull(dynamic json, String key) { if (key.contains('.')) { final keys = key.split('.'); dynamic current = json; - + for (final k in keys) { if (current is Map) { if (!current.containsKey(k)) return null;