From 8ca92453613d6d5f932f79f8199e82fa2b19ec0f Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 15:15:59 +0300 Subject: [PATCH 01/12] feat: Update to v1.5.0 - 86c48uf4c This commit updates the package version to 1.5.0 and includes the following changes: - Updated SDK constraints for Dart (>=3.8.0 <4.0.0) and Flutter (>=3.32.0). - Updated dependencies: - async: ^2.13.0 - playx_core: ^0.7.3 - playx_theme: ^1.1.0 - playx_widget: ^0.3.0 - playx_network: ^0.5.0 - playx_navigation: ^0.2.0 - playx_localization: ^0.3.0 - sentry_flutter: ^9.2.0 - internet_connection_checker_plus: ^2.7.2 - connectivity_plus: ^6.1.4 --- pubspec.yaml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 724760f..3f144a7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: playx description: Playx eco system helps with redundant features as it provides many utilities for themes, widgets and more. -version: 1.4.1 +version: 1.5.0 homepage: https://sourcya.io repository: https://github.com/playx-flutter/playx issue_tracker: https://github.com/playx-flutter/playx/issues @@ -12,32 +12,31 @@ topics: - network environment: - sdk: ">=3.4.1 <4.0.0" - flutter: ">=3.22.0" + sdk: ">=3.8.0 <4.0.0" + flutter: ">=3.32.0" dependencies: flutter: sdk: flutter - async: ^2.11.0 - playx_core: ^0.6.3 - playx_theme: ^1.0.4 - playx_widget: ^0.2.2 - playx_network: ^0.4.0 - playx_navigation: ^0.1.2 - playx_localization: ^0.2.2 + async: ^2.13.0 + playx_core: ^0.7.3 + playx_theme: ^1.1.0 + playx_widget: ^0.3.0 + playx_network: ^0.5.0 + playx_navigation: ^0.2.0 + playx_localization: ^0.3.0 queen_validators: ^1.0.1 - fimber: ^0.7.0 - sentry_flutter: ^8.14.0 + sentry_flutter: ^9.2.0 flutter_animate: ^4.5.2 - internet_connection_checker_plus: ^2.7.1 - connectivity_plus: ^6.1.3 + internet_connection_checker_plus: ^2.7.2 + connectivity_plus: ^6.1.4 get: ^4.7.2 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 flutter: From 237edb36062470dd99f9ea077719251f217c8dd8 Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 15:16:45 +0300 Subject: [PATCH 02/12] fix: Hide TextDirection import to resolve conflicts --- lib/playx.dart | 4 +++- lib/src/playx.dart | 10 ++++------ lib/src/widgets/getx/get_platform_app.dart | 2 +- lib/src/widgets/getx/playx_material_app.dart | 2 +- lib/src/widgets/getx/playx_platform_app.dart | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/playx.dart b/lib/playx.dart index a1fa0a5..9f3c91f 100644 --- a/lib/playx.dart +++ b/lib/playx.dart @@ -1,6 +1,5 @@ export 'package:async/async.dart' hide Result; export 'package:connectivity_plus/connectivity_plus.dart'; -export 'package:fimber/fimber.dart'; export 'package:flutter_animate/flutter_animate.dart'; export 'package:get/get.dart' hide @@ -28,6 +27,9 @@ export 'package:sentry_flutter/sentry_flutter.dart' SentryTraceOrigins, SentrySpanOperations, SanitizedSentryRequest, + SentrySpanData, + SentrySpanDescriptions, + SentrySpanContext, getUtcDateTime, formatDateAsIso8601WithMillisPrecision, jsonSerializationFallback; diff --git a/lib/src/playx.dart b/lib/src/playx.dart index 627115a..16ac494 100644 --- a/lib/src/playx.dart +++ b/lib/src/playx.dart @@ -75,7 +75,6 @@ abstract class Playx { WorkManagerSettings workManagerSettings = const WorkManagerSettings(), PlayxWebSettings webSettings = const PlayxWebSettings(), }) async { - EasyLocalization.logger.name = "Playx"; WidgetsFlutterBinding.ensureInitialized(); assert( @@ -96,13 +95,13 @@ abstract class Playx { ); final envSettingsInstance = envSettingsBuilder?.call() ?? envSettings; - + final logger= PlayxLogger.initLogger(name: 'playx', setAsDefault: false, useColoredFormatter: true); await PlayxCore.bootCore( securePrefsSettings: securePrefsSettings, envSettings: envSettingsInstance, prefsSettings: prefsSettings, workerManagerSettings: workManagerSettings); - EasyLocalization.logger('Core booted ✔'); + logger.i('Core booted ✔'); final localeConfigInstance = localeConfigBuilder?.call() ?? localeConfig!; @@ -111,12 +110,12 @@ abstract class Playx { final themeConfigInstance = themeConfigBuilder?.call() ?? themeConfig!; /// Boot the theme configuration. await PlayxTheme.boot(config: themeConfigInstance); - EasyLocalization.logger('Theme booted ✔'); + logger.i('Theme booted ✔'); final appConfigInstance = appConfigBuilder?.call() ?? appConfig!; /// Boot the app configuration. await appConfigInstance.boot(); - EasyLocalization.logger('AppConfig booted ✔'); + logger.i('AppConfig booted ✔'); /// Set up web navigation settings. PlayxNavigation.setupWeb( @@ -222,6 +221,5 @@ abstract class Playx { await _config?.dispose(); await PlayxTheme.dispose(); await PlayxCore.dispose(); - EasyLocalization.logger('Disposed ✔'); } } diff --git a/lib/src/widgets/getx/get_platform_app.dart b/lib/src/widgets/getx/get_platform_app.dart index 9253583..8bf0f2f 100644 --- a/lib/src/widgets/getx/get_platform_app.dart +++ b/lib/src/widgets/getx/get_platform_app.dart @@ -1,7 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:playx/playx.dart'; +import 'package:playx/playx.dart' hide TextDirection; /// A widget that represents [GetMaterialApp] for Android or Material platforms /// and [GetCupertinoApp] for iOS devices or Cupertino platforms.\ diff --git a/lib/src/widgets/getx/playx_material_app.dart b/lib/src/widgets/getx/playx_material_app.dart index c44d3b3..971a3cc 100644 --- a/lib/src/widgets/getx/playx_material_app.dart +++ b/lib/src/widgets/getx/playx_material_app.dart @@ -4,7 +4,7 @@ import 'package:get/get.dart'; import 'package:playx/src/models/playx_app_settings.dart'; import 'package:playx/src/models/playx_screen_settings.dart'; import 'package:playx/src/models/playx_theme_settings.dart'; -import 'package:playx_localization/playx_localization.dart'; +import 'package:playx_localization/playx_localization.dart' hide TextDirection; import 'package:playx_theme/playx_theme.dart'; import 'package:playx_widget/playx_widget.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; diff --git a/lib/src/widgets/getx/playx_platform_app.dart b/lib/src/widgets/getx/playx_platform_app.dart index b56012f..185628b 100644 --- a/lib/src/widgets/getx/playx_platform_app.dart +++ b/lib/src/widgets/getx/playx_platform_app.dart @@ -6,7 +6,7 @@ import 'package:playx/src/models/playx_app_settings.dart'; import 'package:playx/src/models/playx_platform_settings.dart'; import 'package:playx/src/models/playx_screen_settings.dart'; import 'package:playx/src/models/playx_theme_settings.dart'; -import 'package:playx_localization/playx_localization.dart'; +import 'package:playx_localization/playx_localization.dart' hide TextDirection; import 'package:playx_theme/playx_theme.dart'; import 'package:playx_widget/playx_widget.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; From 42a567422bade6883d58db42b338b01b7cf01acd Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 15:18:52 +0300 Subject: [PATCH 03/12] refactor: update exports --- lib/playx.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/playx.dart b/lib/playx.dart index 9f3c91f..3da850a 100644 --- a/lib/playx.dart +++ b/lib/playx.dart @@ -13,7 +13,7 @@ export 'package:get/get.dart' Trans, ContextExtensionss; export 'package:internet_connection_checker_plus/internet_connection_checker_plus.dart'; -export 'package:playx_localization/playx_localization.dart'; +export 'package:playx_localization/playx_localization.dart' hide TextDirection; export 'package:playx_navigation/playx_navigation.dart'; export 'package:playx_network/playx_network.dart'; export 'package:playx_theme/playx_theme.dart'; @@ -30,6 +30,12 @@ export 'package:sentry_flutter/sentry_flutter.dart' SentrySpanData, SentrySpanDescriptions, SentrySpanContext, + OnBeforeCaptureLog, + BeforeSendEventObserver, + SdkLifecycleCallback, + SdkLifecycleEvent, + addTracingHeadersToHttpHeader, + getBreadcrumbLogLevelFromHttpStatusCode, getUtcDateTime, formatDateAsIso8601WithMillisPrecision, jsonSerializationFallback; From fb356bb3d9ff8954cb08dd74fa860747c67bb464 Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 15:19:26 +0300 Subject: [PATCH 04/12] feat: Improve ConnectionStatusController and internet checks - Updated default internet check URLs to more reliable ones. - Added `backOnlineDelay` to customize the delay before setting status to `connected` after restoration. - Prevented immediate internet check on app resume to avoid redundant calls. --- .../connection_status_controller.dart | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/src/connection_status/connection_status_controller.dart b/lib/src/connection_status/connection_status_controller.dart index c861ed0..032fa75 100644 --- a/lib/src/connection_status/connection_status_controller.dart +++ b/lib/src/connection_status/connection_status_controller.dart @@ -29,6 +29,8 @@ class ConnectionStatusController extends ValueNotifier final Connectivity connectivity = Connectivity(); + final Duration backOnlineDelay; + /// Creates a [ConnectionStatusController] instance with the ability to customize /// the connection check interval and the URLs used to verify internet access. /// @@ -40,6 +42,7 @@ class ConnectionStatusController extends ValueNotifier ConnectionStatusController({ Duration checkInterval = const Duration(seconds: 5), List? customCheckOptions, + this.backOnlineDelay= const Duration(seconds: 2), }) : _internetConnection = _createInternetConnection( checkInterval: checkInterval, customCheckOptions: customCheckOptions), @@ -62,19 +65,21 @@ class ConnectionStatusController extends ValueNotifier customCheckOptions: customCheckOptions ?? [ InternetCheckOption( - uri: Uri.parse('https://icanhazip.com/'), - timeout: 10.seconds), + uri: Uri.parse('https://clients3.google.com/generate_204'), + timeout: 5.seconds, + ), InternetCheckOption( - uri: Uri.parse('https://google.com'), timeout: 10.seconds), + uri: Uri.parse('https://1.1.1.1/generate_204'), + timeout: 5.seconds, + ), InternetCheckOption( - uri: Uri.parse( - 'https://jsonplaceholder.typicode.com/posts/1', - ), - timeout: 10.seconds, + uri: Uri.parse('http://www.msftncsi.com/ncsi.txt'), + timeout: 5.seconds, ), InternetCheckOption( - uri: Uri.parse('https://pokeapi.co/api/v2/pokemon/1'), - timeout: 10.seconds), + uri: Uri.parse('http://captive.apple.com/hotspot-detect.html'), + timeout: 5.seconds, + ), ], useDefaultOptions: false, ); @@ -86,7 +91,7 @@ class ConnectionStatusController extends ValueNotifier void didChangeAppLifecycleState(AppLifecycleState state) { switch (state) { case AppLifecycleState.resumed: - listenToConnectionStatus(); + listenToConnectionStatus(fromLifecycleCallback: true); break; case AppLifecycleState.paused: stopListeningToConnectionStatus(); @@ -111,10 +116,11 @@ class ConnectionStatusController extends ValueNotifier /// Starts listening to internet connection status changes and updates /// the [ConnectionStatus] value in real-time. Also checks the connection /// status immediately upon starting. - Future listenToConnectionStatus() async { + Future listenToConnectionStatus({bool fromLifecycleCallback=false}) async { stopListeningToConnectionStatus(); - checkInternetConnection(); - + if(!fromLifecycleCallback) { + checkInternetConnection(); + } _sub = _internetConnection.onStatusChange.listen((event) async { _handleInternetConnection( isInternetConnected: event == InternetStatus.connected, @@ -148,7 +154,7 @@ class ConnectionStatusController extends ValueNotifier if (value != ConnectionStatus.connected) { value = ConnectionStatus.connectionRestored; } - await Future.delayed(2.seconds); + await Future.delayed(backOnlineDelay); value = ConnectionStatus.connected; } else { value = ConnectionStatus.disconnected; From 6d7d6fd4f4fb51ae24c63b8bd23a2f025020af35 Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 15:22:20 +0300 Subject: [PATCH 05/12] feat: Upgrade example dependencies This commit upgrades the Flutter version and updates several dependencies in the example project. Key changes: - Updated Android example: - Migrated Gradle files to Kotlin DSL (`.kts`). - Updated Android Gradle Plugin to `8.7.3`. - Updated Kotlin Android plugin to `2.1.0`. - Set Java compatibility to version 17. - Updated Gradle wrapper to `8.9`. - Increased Gradle JVM arguments for better performance. - Updated `android/.gitignore` to include `.cxx/` directory. - Updated other platforms. --- .flutter-plugins-dependencies | 2 +- example/.metadata | 30 +-- example/android/.gitignore | 126 +---------- example/android/app/build.gradle | 39 ---- example/android/app/build.gradle.kts | 44 ++++ .../com/example/playx_example/MainActivity.kt | 5 + .../kotlin/com/playx/example/MainActivity.kt | 6 - example/android/build.gradle | 18 -- example/android/build.gradle.kts | 21 ++ example/android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 25 --- example/android/settings.gradle.kts | 25 +++ example/ios/Flutter/Debug.xcconfig | 1 + example/ios/Flutter/Release.xcconfig | 1 + example/ios/Podfile | 43 ++++ example/linux/flutter/generated_plugins.cmake | 1 + example/macos/Flutter/Flutter-Debug.xcconfig | 1 + .../macos/Flutter/Flutter-Release.xcconfig | 1 + example/macos/Podfile | 42 ++++ example/pubspec.lock | 202 +++++++++--------- .../flutter/generated_plugin_registrant.cc | 3 - .../windows/flutter/generated_plugins.cmake | 2 +- 23 files changed, 310 insertions(+), 332 deletions(-) delete mode 100644 example/android/app/build.gradle create mode 100644 example/android/app/build.gradle.kts create mode 100644 example/android/app/src/main/kotlin/com/example/playx_example/MainActivity.kt delete mode 100644 example/android/app/src/main/kotlin/com/playx/example/MainActivity.kt delete mode 100644 example/android/build.gradle create mode 100644 example/android/build.gradle.kts delete mode 100644 example/android/settings.gradle create mode 100644 example/android/settings.gradle.kts create mode 100644 example/ios/Podfile create mode 100644 example/macos/Podfile diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 7ae4f48..4bac593 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":"shared_preferences_ios","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_ios-2.1.1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.14\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_macos-2.0.4\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.1.2\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.1.3\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.1.2\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"C:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.4\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_ios","shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_ios","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2022-12-27 12:24:49.796619","version":"3.3.9"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_temp_fork","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_temp_fork-0.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus"],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sqflite_darwin-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_temp_fork","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_temp_fork-0.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/jni-0.14.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/path_provider_android-2.2.17/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus","jni"],"dev_dependency":false},{"name":"shared_preferences_android","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.10/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_android","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sqflite_android-2.4.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_macos","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_macos-1.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus"],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sqflite_darwin-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_linux","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_linux-1.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/jni-0.14.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus","jni"],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_windows","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_windows-1.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/jni-0.14.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus","jni"],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_temp_fork","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_temp_fork-0.1.5/","dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","dependencies":["package_info_plus"],"dev_dependency":false},{"name":"shared_preferences_web","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"flutter_keyboard_visibility_linux","dependencies":[]},{"name":"flutter_keyboard_visibility_macos","dependencies":[]},{"name":"flutter_keyboard_visibility_temp_fork","dependencies":["flutter_keyboard_visibility_linux","flutter_keyboard_visibility_macos","flutter_keyboard_visibility_windows"]},{"name":"flutter_keyboard_visibility_windows","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_macos","flutter_secure_storage_web"]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"jni","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"sentry_flutter","dependencies":["package_info_plus","jni"]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_web"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":["sqflite_android","sqflite_darwin"]},{"name":"sqflite_android","dependencies":[]},{"name":"sqflite_darwin","dependencies":[]}],"date_created":"2025-07-02 14:56:49.799620","version":"3.32.5","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/example/.metadata b/example/.metadata index fac5aec..fdb4416 100644 --- a/example/.metadata +++ b/example/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3" + revision: "fcf2c11572af6f390246c056bc905eca609533a0" channel: "stable" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: fcf2c11572af6f390246c056bc905eca609533a0 + base_revision: fcf2c11572af6f390246c056bc905eca609533a0 - platform: android - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: fcf2c11572af6f390246c056bc905eca609533a0 + base_revision: fcf2c11572af6f390246c056bc905eca609533a0 - platform: ios - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: fcf2c11572af6f390246c056bc905eca609533a0 + base_revision: fcf2c11572af6f390246c056bc905eca609533a0 - platform: linux - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: fcf2c11572af6f390246c056bc905eca609533a0 + base_revision: fcf2c11572af6f390246c056bc905eca609533a0 - platform: macos - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: fcf2c11572af6f390246c056bc905eca609533a0 + base_revision: fcf2c11572af6f390246c056bc905eca609533a0 - platform: web - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: fcf2c11572af6f390246c056bc905eca609533a0 + base_revision: fcf2c11572af6f390246c056bc905eca609533a0 - platform: windows - create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 - base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3 + create_revision: fcf2c11572af6f390246c056bc905eca609533a0 + base_revision: fcf2c11572af6f390246c056bc905eca609533a0 # User provided section diff --git a/example/android/.gitignore b/example/android/.gitignore index 14e5c9a..be3943c 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -5,134 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks -/app/.cxx/Debug/3z3j495b/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2 -/app/.cxx/Debug/3z3j495b/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 -/app/.cxx/Debug/3z3j495b/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2 -/app/.cxx/Debug/3z3j495b/arm64-v8a/.cmake/api/v1/reply/cache-v2-18571856890350f0824d.json -/app/.cxx/Debug/3z3j495b/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-d11fca9ba96e713762d9.json -/app/.cxx/Debug/3z3j495b/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-2eea782cc0a3e7d384fe.json -/app/.cxx/Debug/3z3j495b/arm64-v8a/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json -/app/.cxx/Debug/3z3j495b/arm64-v8a/.cmake/api/v1/reply/index-2025-03-12T19-05-16-0682.json -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/cmake.check_cache -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/rules.ninja -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeFiles/TargetDirectories.txt -/app/.cxx/Debug/3z3j495b/arm64-v8a/additional_project_files.txt -/app/.cxx/Debug/3z3j495b/arm64-v8a/android_gradle_build.json -/app/.cxx/Debug/3z3j495b/arm64-v8a/android_gradle_build_mini.json -/app/.cxx/Debug/3z3j495b/arm64-v8a/build.ninja -/app/.cxx/Debug/3z3j495b/arm64-v8a/build_file_index.txt -/app/.cxx/Debug/3z3j495b/arm64-v8a/cmake_install.cmake -/app/.cxx/Debug/3z3j495b/arm64-v8a/CMakeCache.txt -/app/.cxx/Debug/3z3j495b/arm64-v8a/configure_fingerprint.bin -/app/.cxx/Debug/3z3j495b/arm64-v8a/metadata_generation_command.txt -/app/.cxx/Debug/3z3j495b/arm64-v8a/prefab_config.json -/app/.cxx/Debug/3z3j495b/arm64-v8a/symbol_folder_index.txt -/app/.cxx/Debug/3z3j495b/armeabi-v7a/.cmake/api/v1/query/client-agp/cache-v2 -/app/.cxx/Debug/3z3j495b/armeabi-v7a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 -/app/.cxx/Debug/3z3j495b/armeabi-v7a/.cmake/api/v1/query/client-agp/codemodel-v2 -/app/.cxx/Debug/3z3j495b/armeabi-v7a/.cmake/api/v1/reply/cache-v2-efc38ddb025d20aa9f54.json -/app/.cxx/Debug/3z3j495b/armeabi-v7a/.cmake/api/v1/reply/cmakeFiles-v1-2c67d48941a5c2515bb2.json -/app/.cxx/Debug/3z3j495b/armeabi-v7a/.cmake/api/v1/reply/codemodel-v2-4dcf0f14cee4d381c28d.json -/app/.cxx/Debug/3z3j495b/armeabi-v7a/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json -/app/.cxx/Debug/3z3j495b/armeabi-v7a/.cmake/api/v1/reply/index-2025-03-12T19-05-27-0226.json -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/cmake.check_cache -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/rules.ninja -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeFiles/TargetDirectories.txt -/app/.cxx/Debug/3z3j495b/armeabi-v7a/additional_project_files.txt -/app/.cxx/Debug/3z3j495b/armeabi-v7a/android_gradle_build.json -/app/.cxx/Debug/3z3j495b/armeabi-v7a/android_gradle_build_mini.json -/app/.cxx/Debug/3z3j495b/armeabi-v7a/build.ninja -/app/.cxx/Debug/3z3j495b/armeabi-v7a/build_file_index.txt -/app/.cxx/Debug/3z3j495b/armeabi-v7a/cmake_install.cmake -/app/.cxx/Debug/3z3j495b/armeabi-v7a/CMakeCache.txt -/app/.cxx/Debug/3z3j495b/armeabi-v7a/configure_fingerprint.bin -/app/.cxx/Debug/3z3j495b/armeabi-v7a/metadata_generation_command.txt -/app/.cxx/Debug/3z3j495b/armeabi-v7a/prefab_config.json -/app/.cxx/Debug/3z3j495b/armeabi-v7a/symbol_folder_index.txt -/app/.cxx/Debug/3z3j495b/x86/.cmake/api/v1/query/client-agp/cache-v2 -/app/.cxx/Debug/3z3j495b/x86/.cmake/api/v1/query/client-agp/cmakeFiles-v1 -/app/.cxx/Debug/3z3j495b/x86/.cmake/api/v1/query/client-agp/codemodel-v2 -/app/.cxx/Debug/3z3j495b/x86/.cmake/api/v1/reply/cache-v2-0f36b46314711f555579.json -/app/.cxx/Debug/3z3j495b/x86/.cmake/api/v1/reply/cmakeFiles-v1-d03af4cbaff4c35023ba.json -/app/.cxx/Debug/3z3j495b/x86/.cmake/api/v1/reply/codemodel-v2-14966da1d6ce366fbfa3.json -/app/.cxx/Debug/3z3j495b/x86/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json -/app/.cxx/Debug/3z3j495b/x86/.cmake/api/v1/reply/index-2025-03-12T19-05-35-0807.json -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/cmake.check_cache -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/rules.ninja -/app/.cxx/Debug/3z3j495b/x86/CMakeFiles/TargetDirectories.txt -/app/.cxx/Debug/3z3j495b/x86/additional_project_files.txt -/app/.cxx/Debug/3z3j495b/x86/android_gradle_build.json -/app/.cxx/Debug/3z3j495b/x86/android_gradle_build_mini.json -/app/.cxx/Debug/3z3j495b/x86/build.ninja -/app/.cxx/Debug/3z3j495b/x86/build_file_index.txt -/app/.cxx/Debug/3z3j495b/x86/cmake_install.cmake -/app/.cxx/Debug/3z3j495b/x86/CMakeCache.txt -/app/.cxx/Debug/3z3j495b/x86/configure_fingerprint.bin -/app/.cxx/Debug/3z3j495b/x86/metadata_generation_command.txt -/app/.cxx/Debug/3z3j495b/x86/prefab_config.json -/app/.cxx/Debug/3z3j495b/x86/symbol_folder_index.txt -/app/.cxx/Debug/3z3j495b/x86_64/.cmake/api/v1/query/client-agp/cache-v2 -/app/.cxx/Debug/3z3j495b/x86_64/.cmake/api/v1/query/client-agp/cmakeFiles-v1 -/app/.cxx/Debug/3z3j495b/x86_64/.cmake/api/v1/query/client-agp/codemodel-v2 -/app/.cxx/Debug/3z3j495b/x86_64/.cmake/api/v1/reply/cache-v2-919a7980865cfcc51ea3.json -/app/.cxx/Debug/3z3j495b/x86_64/.cmake/api/v1/reply/cmakeFiles-v1-7a0f6549ce0008eda020.json -/app/.cxx/Debug/3z3j495b/x86_64/.cmake/api/v1/reply/codemodel-v2-75f2e3a96ca61039dced.json -/app/.cxx/Debug/3z3j495b/x86_64/.cmake/api/v1/reply/directory-.-Debug-d0094a50bb2071803777.json -/app/.cxx/Debug/3z3j495b/x86_64/.cmake/api/v1/reply/index-2025-03-12T19-05-55-0131.json -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.c -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdC/CMakeCCompilerId.o -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.cpp -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CompilerIdCXX/CMakeCXXCompilerId.o -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCCompiler.cmake -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeCXXCompiler.cmake -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_C.bin -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeDetermineCompilerABI_CXX.bin -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/3.22.1-g37088a8-dirty/CMakeSystem.cmake -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/cmake.check_cache -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/rules.ninja -/app/.cxx/Debug/3z3j495b/x86_64/CMakeFiles/TargetDirectories.txt -/app/.cxx/Debug/3z3j495b/x86_64/additional_project_files.txt -/app/.cxx/Debug/3z3j495b/x86_64/android_gradle_build.json -/app/.cxx/Debug/3z3j495b/x86_64/android_gradle_build_mini.json -/app/.cxx/Debug/3z3j495b/x86_64/build.ninja -/app/.cxx/Debug/3z3j495b/x86_64/build_file_index.txt -/app/.cxx/Debug/3z3j495b/x86_64/cmake_install.cmake -/app/.cxx/Debug/3z3j495b/x86_64/CMakeCache.txt -/app/.cxx/Debug/3z3j495b/x86_64/configure_fingerprint.bin -/app/.cxx/Debug/3z3j495b/x86_64/metadata_generation_command.txt -/app/.cxx/Debug/3z3j495b/x86_64/prefab_config.json -/app/.cxx/Debug/3z3j495b/x86_64/symbol_folder_index.txt -/app/.cxx/Debug/3z3j495b/hash_key.txt diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index cc10986..0000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,39 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. - id "dev.flutter.flutter-gradle-plugin" -} - -android { - namespace = "com.playx.example" - compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 - } - - defaultConfig { - applicationId "com.playx.example" - minSdk = flutter.minSdkVersion - targetSdk = flutter.targetSdkVersion - versionCode = flutter.versionCode - versionName = flutter.versionName - } - - buildTypes { - release { - signingConfig = signingConfigs.debug - } - } -} - -flutter { - source = "../.." -} diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts new file mode 100644 index 0000000..c5d9477 --- /dev/null +++ b/example/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.playx_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.playx_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 + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/example/android/app/src/main/kotlin/com/example/playx_example/MainActivity.kt b/example/android/app/src/main/kotlin/com/example/playx_example/MainActivity.kt new file mode 100644 index 0000000..6152394 --- /dev/null +++ b/example/android/app/src/main/kotlin/com/example/playx_example/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.playx_example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/example/android/app/src/main/kotlin/com/playx/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/playx/example/MainActivity.kt deleted file mode 100644 index 6570649..0000000 --- a/example/android/app/src/main/kotlin/com/playx/example/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.playx.example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/example/android/build.gradle b/example/android/build.gradle deleted file mode 100644 index d2ffbff..0000000 --- a/example/android/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = "../build" -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(":app") -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/example/android/build.gradle.kts b/example/android/build.gradle.kts new file mode 100644 index 0000000..89176ef --- /dev/null +++ b/example/android/build.gradle.kts @@ -0,0 +1,21 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 2597170..f018a61 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 5e6b542..348c409 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index 5c58366..0000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.3.2" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false -} - -include ":app" diff --git a/example/android/settings.gradle.kts b/example/android/settings.gradle.kts new file mode 100644 index 0000000..ab39a10 --- /dev/null +++ b/example/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.3" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false +} + +include(":app") diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Podfile b/example/ios/Podfile new file mode 100644 index 0000000..e549ee2 --- /dev/null +++ b/example/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index fbd7764..fdcc252 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -8,6 +8,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/example/macos/Flutter/Flutter-Debug.xcconfig b/example/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/example/macos/Flutter/Flutter-Debug.xcconfig +++ b/example/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/example/macos/Flutter/Flutter-Release.xcconfig b/example/macos/Flutter/Flutter-Release.xcconfig index c2efd0b..5caa9d1 100644 --- a/example/macos/Flutter/Flutter-Release.xcconfig +++ b/example/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/example/macos/Podfile b/example/macos/Podfile new file mode 100644 index 0000000..29c8eb3 --- /dev/null +++ b/example/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/example/pubspec.lock b/example/pubspec.lock index 11bb014..4c97b3e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -9,6 +9,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.10" + ansicolor: + dependency: transitive + description: + name: ansicolor + sha256: "50e982d500bc863e1d703448afdbf9e5a72eb48840a4f766fa361ffd6877055f" + url: "https://pub.dev" + source: hosted + version: "2.0.3" archive: dependency: transitive description: @@ -21,18 +29,18 @@ packages: dependency: transitive description: name: args - sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.7.0" async: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -93,10 +101,10 @@ packages: dependency: transitive description: name: connectivity_plus - sha256: "04bf81bb0b77de31557b58d052b24b3eee33f09a6e7a8c68a3e247c7df19ec27" + sha256: "051849e2bd7c7b3bc5844ea0d096609ddc3a859890ec3a9ac4a65a2620cc1f99" url: "https://pub.dev" source: hosted - version: "6.1.3" + version: "6.1.4" connectivity_plus_platform_interface: dependency: transitive description: @@ -149,26 +157,10 @@ packages: dependency: transitive description: name: dotted_border - sha256: "108837e11848ca776c53b30bc870086f84b62ed6e01c503ed976e8f8c7df9c04" + sha256: "99b091ec6891ba0c5331fdc2b502993c7c108f898995739a73c6845d71dad70c" url: "https://pub.dev" source: hosted - version: "2.1.0" - easy_localization: - dependency: transitive - description: - name: easy_localization - sha256: fa59bcdbbb911a764aa6acf96bbb6fa7a5cf8234354fc45ec1a43a0349ef0201 - url: "https://pub.dev" - source: hosted - version: "3.0.7" - easy_logger: - dependency: transitive - description: - name: easy_logger - sha256: c764a6e024846f33405a2342caf91c62e357c24b02c04dbc712ef232bf30ffb7 - url: "https://pub.dev" - source: hosted - version: "0.0.2" + version: "3.1.0" email_validator: dependency: transitive description: @@ -189,10 +181,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" ffi: dependency: transitive description: @@ -209,14 +201,6 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" - fimber: - dependency: transitive - description: - name: fimber - sha256: "42fcfa33acd43556c1e7ebfc12c2b03893418bc04a07931368c3573e228af2f0" - url: "https://pub.dev" - source: hosted - version: "0.7.0" fixnum: dependency: transitive description: @@ -229,10 +213,10 @@ packages: dependency: transitive description: name: flex_seed_scheme - sha256: d3ba3c5c92d2d79d45e94b4c6c71d01fac3c15017da1545880c53864da5dfeb0 + sha256: b06d8b367b84cbf7ca5c5603c858fa5edae88486c4e4da79ac1044d73b6c62ec url: "https://pub.dev" source: hosted - version: "3.5.0" + version: "3.5.1" flutter: dependency: "direct main" description: flutter @@ -319,10 +303,10 @@ packages: dependency: transitive description: name: flutter_platform_widgets - sha256: ba28f1a1ee7e46e2b7315405868c2d7126ba67e74e83e9a80538f8d5b5df7b21 + sha256: "22a86564cb6cc0b93637c813ca91b0b1f61c2681a31e0f9d77590c1fa9f12020" url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "9.0.0" flutter_screenutil: dependency: transitive description: @@ -391,10 +375,10 @@ packages: dependency: transitive description: name: flutter_svg - sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" + sha256: cd57f7969b4679317c17af6fd16ee233c1e60a82ed209d8a475c54fd6fd6f845 url: "https://pub.dev" source: hosted - version: "2.0.10+1" + version: "2.2.0" flutter_svg_provider: dependency: transitive description: @@ -441,10 +425,10 @@ packages: dependency: transitive description: name: go_router - sha256: f02fd7d2a4dc512fec615529824fdd217fecb3a3d3de68360293a551f21634b3 + sha256: c489908a54ce2131f1d1b7cc631af9c1a06fac5ca7c449e959192089f9489431 url: "https://pub.dev" source: hosted - version: "14.8.1" + version: "16.0.0" http: dependency: transitive description: @@ -465,18 +449,26 @@ packages: dependency: transitive description: name: internet_connection_checker_plus - sha256: eb3a6f03e7b1641589f580993d29aee0b3c4920fc618f7556de359fedb87b02e + sha256: "5aea4a1ee0fcca736980a7d04d96fe8c0b53dea330690053305a5c5392230112" url: "https://pub.dev" source: hosted - version: "2.7.1" + version: "2.7.2" intl: dependency: transitive description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" url: "https://pub.dev" source: hosted - version: "0.19.0" + version: "0.20.2" + jni: + dependency: transitive + description: + name: jni + sha256: cfd663ec90d87ec6abd338da7e21189e503bf6753a0027c1862796f5826adba6 + url: "https://pub.dev" + source: hosted + version: "0.14.1" js: dependency: transitive description: @@ -489,10 +481,10 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: @@ -573,6 +565,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" package_info_plus: dependency: transitive description: @@ -597,14 +597,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" - path_drawing: - dependency: transitive - description: - name: path_drawing - sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977 - url: "https://pub.dev" - source: hosted - version: "1.0.1" path_parsing: dependency: transitive description: @@ -683,55 +675,55 @@ packages: path: ".." relative: true source: path - version: "1.4.1" + version: "1.5.0" playx_core: dependency: transitive description: name: playx_core - sha256: b96bd6fc2dbf3bfeacfec1972b69355118f1e0a3823977a6517eac5389d4fac6 + sha256: "2ec52210e11918d2d4d86580ee9f859da434346ffb2fecbb3f903d931414f369" url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.7.3" playx_localization: dependency: transitive description: name: playx_localization - sha256: cf18e0c904966b39e8799fb3fd0841716344bb0c98f8091f76f598c21651db82 + sha256: dae435c1f2f2d5478af4c0df22856c763e877b5480afa7c8e3e485b2551a0851 url: "https://pub.dev" source: hosted - version: "0.2.2" + version: "0.3.0" playx_navigation: dependency: transitive description: name: playx_navigation - sha256: "5a63ab7d7f4afe5b2c14d4f04c7465006ca551fb11bfbd3a5bf99d0c840ee18a" + sha256: "5a0018abdbfc45b48096270b5a69bdf21d953863f34a9e760f4430a0e08d3235" url: "https://pub.dev" source: hosted - version: "0.1.2" + version: "0.2.0" playx_network: dependency: transitive description: name: playx_network - sha256: "88ecf7d95bd020b28149c9c825a74c0ab3f0ce589ac27dbf9c5da77479ccc6ba" + sha256: ada658950e412132ecd2c2aa32336e557fda341347fe9ef60a4d4bd7b7b0b5a8 url: "https://pub.dev" source: hosted - version: "0.4.0" + version: "0.5.0" playx_theme: dependency: transitive description: name: playx_theme - sha256: "872b6fa0649197237d3d0f6385b5f6448a924da07f3bda8bdac54e61434e6b68" + sha256: f73ca1ee6c84fe5fb49380ed6d34f6d8a8de4f3adc9601f5a3b60518ecba7bdd url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.1.0" playx_widget: dependency: transitive description: name: playx_widget - sha256: "25c47cc0bbcd0b7e05a25accbdd5af9a74a42548811134db598fce03225cf430" + sha256: "1f64db61c7a1cadc353ce0491a210c9bdf327cfbfd05f2688b6ca491604cd65a" url: "https://pub.dev" source: hosted - version: "0.2.2" + version: "0.3.0" plugin_platform_interface: dependency: transitive description: @@ -748,14 +740,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.1" - pretty_dio_logger: - dependency: transitive - description: - name: pretty_dio_logger - sha256: "36f2101299786d567869493e2f5731de61ce130faa14679473b26905a92b6407" - url: "https://pub.dev" - source: hosted - version: "1.4.0" queen_validators: dependency: transitive description: @@ -776,34 +760,34 @@ packages: dependency: transitive description: name: sentry - sha256: "3a64dd001bff768ce5ab6fc3608deef4dde22acd4b5d947763557b20db9e2a32" + sha256: "40583b61f5f4dc0ea7095a34c03cd71e17b43bd8866fba34972398f70806b464" url: "https://pub.dev" source: hosted - version: "8.14.0" + version: "9.2.0" sentry_dio: dependency: transitive description: name: sentry_dio - sha256: f810a71b36e0e0a3405baf7f3eeaa8481ca55bb65a5822f0befc5bdda0049264 + sha256: "62836fb92b6d3b38748469c63cb60df60917d2d85214d94051c7424e960450c9" url: "https://pub.dev" source: hosted - version: "8.14.0" + version: "9.2.0" sentry_flutter: dependency: transitive description: name: sentry_flutter - sha256: "3d361f2d5f805783e2e4ed1bd475ef126b36cf525b359dc3627a765a3fb7424d" + sha256: "12a855e6d415d9433e1a0f4462e5c06862d2ecf6f4b0b22de52d76cff03e594a" url: "https://pub.dev" source: hosted - version: "8.14.0" + version: "9.2.0" shared_preferences: dependency: transitive description: name: shared_preferences - sha256: "846849e3e9b68f3ef4b60c60cf4b3e02e9321bc7f4d8c4692cf87ffa82fc8a3a" + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.3" shared_preferences_android: dependency: transitive description: @@ -929,6 +913,30 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.0" + talker: + dependency: transitive + description: + name: talker + sha256: cf02a0d294701c76022f32bc8eb7e6f943953eb17fa1f8aaee56af210848134b + url: "https://pub.dev" + source: hosted + version: "4.9.1" + talker_dio_logger: + dependency: transitive + description: + name: talker_dio_logger + sha256: "926688b8ee3d4328d16a978d2d400145afec5448b32014bbb255904bfa648c6e" + url: "https://pub.dev" + source: hosted + version: "4.9.1" + talker_logger: + dependency: transitive + description: + name: talker_logger + sha256: f1755d517e5ca8b119b65ad2fc1079746a8d03bd565e75d6b9d5aedf5c1d5b15 + url: "https://pub.dev" + source: hosted + version: "4.9.1" term_glyph: dependency: transitive description: @@ -965,10 +973,10 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.19" vector_graphics_codec: dependency: transitive description: @@ -981,10 +989,10 @@ packages: dependency: transitive description: name: vector_graphics_compiler - sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" + sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331" url: "https://pub.dev" source: hosted - version: "1.1.11+1" + version: "1.1.17" vector_math: dependency: transitive description: @@ -997,18 +1005,18 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.0" web: dependency: transitive description: name: web - sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.1" win32: dependency: transitive description: @@ -1029,10 +1037,10 @@ packages: dependency: transitive description: name: worker_manager - sha256: "0c6c4e7d246bcbe7221273ef955732dafb097347d536ebe6acd6547d0398c49c" + sha256: af3db5e6c6c8a74ab8f72e25e9d305f8ff60984ca55551397e3c8828ebf30509 url: "https://pub.dev" source: hosted - version: "7.2.2" + version: "7.2.6" xdg_directories: dependency: transitive description: @@ -1050,5 +1058,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.7.0-0 <4.0.0" - flutter: ">=3.29.0" + dart: ">=3.8.0 <4.0.0" + flutter: ">=3.32.0" diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc index 990e53a..056c5ad 100644 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ b/example/windows/flutter/generated_plugin_registrant.cc @@ -7,14 +7,11 @@ #include "generated_plugin_registrant.h" #include -#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { ConnectivityPlusWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); - FlutterSecureStorageWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); SentryFlutterPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("SentryFlutterPlugin")); } diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 77245fb..f07a5e2 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -4,11 +4,11 @@ list(APPEND FLUTTER_PLUGIN_LIST connectivity_plus - flutter_secure_storage_windows sentry_flutter ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) From 00a6a3d339d18e775e2b4ab3387b283d319f5bda Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 16:07:11 +0300 Subject: [PATCH 06/12] refactor: Update example app --- example/lib/config/app_config.dart | 9 +++++---- example/lib/connection_status_widget.dart | 3 +++ example/lib/home.dart | 17 +++++++++-------- pubspec.yaml | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/example/lib/config/app_config.dart b/example/lib/config/app_config.dart index 009a553..62db544 100644 --- a/example/lib/config/app_config.dart +++ b/example/lib/config/app_config.dart @@ -8,10 +8,11 @@ class AppConfig extends PlayXAppConfig { @override Future boot() async { - if (kDebugMode) { - Fimber.plantTree(DebugTree()); - } - + PlayxLogger.initLogger( + name: 'Playx Example', + settings: PlayxLoggerSettings( + enabled: kDebugMode, + )); final apiClient = PlayxNetworkClient( dio: Dio( BaseOptions( diff --git a/example/lib/connection_status_widget.dart b/example/lib/connection_status_widget.dart index 14f13c9..90ca16e 100644 --- a/example/lib/connection_status_widget.dart +++ b/example/lib/connection_status_widget.dart @@ -41,14 +41,17 @@ class _ConnectionStatusWidgetState extends State { setState(() { msg = 'Connected to Internet'; }); + PlayxLogger.i('ConnectionStatusWidget: Connected to Internet'); case ConnectionStatus.disconnected: setState(() { msg = 'Disconnected From Internet'; }); + PlayxLogger.error('ConnectionStatusWidget: Disconnected From Internet'); case ConnectionStatus.connectionRestored: setState(() { msg = 'Connection RESTORED INTERNET'; }); + PlayxLogger.w('ConnectionStatusWidget: Connection RESTORED INTERNET'); if (widget.retryOnConnectionRestored) { widget.onRetryClicked?.call(); } diff --git a/example/lib/home.dart b/example/lib/home.dart index 5695065..3045632 100644 --- a/example/lib/home.dart +++ b/example/lib/home.dart @@ -60,17 +60,19 @@ class _HomeState extends State { else Text( _weatherMsg, - style: Theme.of(context).textTheme.headlineMedium, + style: + TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400), + textAlign: TextAlign.center, ), Text( _envText, textAlign: TextAlign.center, style: - TextStyle(fontSize: 26.sp, fontWeight: FontWeight.w400), + TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w400), ), ImageViewer.network( 'https://avatars.githubusercontent.com/u/35397170?s=200&v=4', - height: 100.w, + height: 100.r, ), ElevatedButton( child: @@ -151,14 +153,13 @@ class _HomeState extends State { ? const Icon(Icons.check) : null, onTap: () async { - // PlayxTheme.updateByIndex( - // index, - // ); Navigator.of(dialogContext) .pop(); // Dismiss alert dialog - PlayxTheme.updateById( - PlayxTheme.supportedThemes[index].id); + PlayxTheme.updateByIndex( + index, + animation: PlayxThemeClipperAnimation() + ); }, ), )), diff --git a/pubspec.yaml b/pubspec.yaml index 3f144a7..28623ad 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,7 +22,7 @@ dependencies: playx_core: ^0.7.3 playx_theme: ^1.1.0 playx_widget: ^0.3.0 - playx_network: ^0.5.0 + playx_network: ^0.5.1 playx_navigation: ^0.2.0 playx_localization: ^0.3.0 queen_validators: ^1.0.1 From a3a905be4ab2dc0e5eccd1a9cc15d0ade9499d7f Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 16:07:43 +0300 Subject: [PATCH 07/12] refactor: code cleanup --- example/lib/config/app_config.dart | 4 +- example/lib/connection_status_widget.dart | 6 +- example/lib/home.dart | 36 +- example/lib/main.dart | 14 +- example/pubspec.lock | 4 +- .../connection_status_controller.dart | 76 ++-- .../models/playx_get_navigation_settings.dart | 28 +- lib/src/models/playx_navigation_settings.dart | 59 ++- lib/src/models/playx_web_settings.dart | 6 +- lib/src/playx.dart | 97 +++-- lib/src/utils/is_equal_validation.dart | 16 +- lib/src/widgets/getx/get_platform_app.dart | 30 +- lib/src/widgets/getx/playx_material_app.dart | 299 +++++++-------- lib/src/widgets/getx/playx_platform_app.dart | 347 +++++++++--------- lib/src/widgets/playx_material_app.dart | 224 +++++------ lib/src/widgets/playx_platform_app.dart | 231 ++++++------ 16 files changed, 780 insertions(+), 697 deletions(-) diff --git a/example/lib/config/app_config.dart b/example/lib/config/app_config.dart index 62db544..3db8608 100644 --- a/example/lib/config/app_config.dart +++ b/example/lib/config/app_config.dart @@ -11,8 +11,8 @@ class AppConfig extends PlayXAppConfig { PlayxLogger.initLogger( name: 'Playx Example', settings: PlayxLoggerSettings( - enabled: kDebugMode, - )); + enabled: kDebugMode, + )); final apiClient = PlayxNetworkClient( dio: Dio( BaseOptions( diff --git a/example/lib/connection_status_widget.dart b/example/lib/connection_status_widget.dart index 90ca16e..a7582dd 100644 --- a/example/lib/connection_status_widget.dart +++ b/example/lib/connection_status_widget.dart @@ -6,7 +6,8 @@ class ConnectionStatusWidget extends StatefulWidget { final bool retryOnConnectionRestored; final VoidCallback? onRetryClicked; - const ConnectionStatusWidget({super.key, + const ConnectionStatusWidget({ + super.key, this.enableCheckingInternet = true, this.onRetryClicked, this.retryOnConnectionRestored = true, @@ -46,7 +47,8 @@ class _ConnectionStatusWidgetState extends State { setState(() { msg = 'Disconnected From Internet'; }); - PlayxLogger.error('ConnectionStatusWidget: Disconnected From Internet'); + PlayxLogger.error( + 'ConnectionStatusWidget: Disconnected From Internet'); case ConnectionStatus.connectionRestored: setState(() { msg = 'Connection RESTORED INTERNET'; diff --git a/example/lib/home.dart b/example/lib/home.dart index 3045632..0f77c5c 100644 --- a/example/lib/home.dart +++ b/example/lib/home.dart @@ -61,26 +61,27 @@ class _HomeState extends State { Text( _weatherMsg, style: - TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400), + TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400), textAlign: TextAlign.center, ), Text( _envText, textAlign: TextAlign.center, - style: - TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w400), + style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w400), ), ImageViewer.network( 'https://avatars.githubusercontent.com/u/35397170?s=200&v=4', height: 100.r, ), ElevatedButton( - child: - Text(AppTrans.changeLanguageTitle.tr(context: context)), + child: Text(AppTrans.changeLanguageTitle.tr(context: context)), onPressed: () { showDialog( context: PlayxNavigation.navigationContext!, - builder: (ctx,)=> Center( + builder: ( + ctx, + ) => + Center( child: Card( margin: const EdgeInsets.all(8), child: Column( @@ -97,14 +98,14 @@ class _HomeState extends State { PlayxNavigation.pop(); }, title: Text(e.name), - trailing: PlayxLocalization - .currentXLocale.id == - e.id - ? const Icon( - Icons.done, - color: Colors.lightBlue, - ) - : const SizedBox.shrink(), + trailing: + PlayxLocalization.currentXLocale.id == + e.id + ? const Icon( + Icons.done, + color: Colors.lightBlue, + ) + : const SizedBox.shrink(), )), ], ), @@ -156,10 +157,9 @@ class _HomeState extends State { Navigator.of(dialogContext) .pop(); // Dismiss alert dialog - PlayxTheme.updateByIndex( - index, - animation: PlayxThemeClipperAnimation() - ); + PlayxTheme.updateByIndex(index, + animation: + PlayxThemeClipperAnimation()); }, ), )), diff --git a/example/lib/main.dart b/example/lib/main.dart index 5c86e4f..025f9a4 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -8,15 +8,14 @@ import 'package:playx_example/translation/app_trans.dart'; import 'config/app_config.dart'; void main() async { - Playx.runPlayx( - appConfigBuilder:()=> AppConfig(), - themeConfigBuilder:()=> createThemeConfig(), - envSettingsBuilder:()=> const PlayxEnvSettings( + appConfigBuilder: () => AppConfig(), + themeConfigBuilder: () => createThemeConfig(), + envSettingsBuilder: () => const PlayxEnvSettings( fileName: 'assets/env/keys.env', ), - localeConfigBuilder:()=> createLocaleConfig(), - app:const MyApp(), + localeConfigBuilder: () => createLocaleConfig(), + app: const MyApp(), //not necessary // sentryOptions: (options) { // options.dsn = AppConfig.sentryKey; @@ -24,18 +23,15 @@ void main() async { ); } - final goRouter = GoRouter( routes: [ PlayxRoute(path: '/', builder: (context, state) => const Home()), ], ); - class MyApp extends StatelessWidget { const MyApp({super.key}); - @override Widget build(BuildContext context) { return PlayxMaterialApp( diff --git a/example/pubspec.lock b/example/pubspec.lock index 4c97b3e..dbe5357 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -704,10 +704,10 @@ packages: dependency: transitive description: name: playx_network - sha256: ada658950e412132ecd2c2aa32336e557fda341347fe9ef60a4d4bd7b7b0b5a8 + sha256: a4f42b930fc20adbc9e128f98cf8d59a88d7a66150d35f5d47441f92e22de2c7 url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.5.1" playx_theme: dependency: transitive description: diff --git a/lib/src/connection_status/connection_status_controller.dart b/lib/src/connection_status/connection_status_controller.dart index 032fa75..c4c5f5f 100644 --- a/lib/src/connection_status/connection_status_controller.dart +++ b/lib/src/connection_status/connection_status_controller.dart @@ -12,7 +12,7 @@ enum ConnectionStatus { disconnected, /// The device lost connection but then restored it. - connectionRestored; + connectionRestored, } /// A controller that monitors the internet connection status by checking the @@ -42,11 +42,12 @@ class ConnectionStatusController extends ValueNotifier ConnectionStatusController({ Duration checkInterval = const Duration(seconds: 5), List? customCheckOptions, - this.backOnlineDelay= const Duration(seconds: 2), - }) : _internetConnection = _createInternetConnection( - checkInterval: checkInterval, - customCheckOptions: customCheckOptions), - super(ConnectionStatus.connected) { + this.backOnlineDelay = const Duration(seconds: 2), + }) : _internetConnection = _createInternetConnection( + checkInterval: checkInterval, + customCheckOptions: customCheckOptions, + ), + super(ConnectionStatus.connected) { WidgetsBinding.instance.addObserver(this); listenToConnectionStatus(); } @@ -59,30 +60,30 @@ class ConnectionStatusController extends ValueNotifier static InternetConnection _createInternetConnection({ Duration checkInterval = const Duration(seconds: 5), List? customCheckOptions, - }) => - InternetConnection.createInstance( - checkInterval: checkInterval, - customCheckOptions: customCheckOptions ?? - [ - InternetCheckOption( - uri: Uri.parse('https://clients3.google.com/generate_204'), - timeout: 5.seconds, - ), - InternetCheckOption( - uri: Uri.parse('https://1.1.1.1/generate_204'), - timeout: 5.seconds, - ), - InternetCheckOption( - uri: Uri.parse('http://www.msftncsi.com/ncsi.txt'), - timeout: 5.seconds, - ), - InternetCheckOption( - uri: Uri.parse('http://captive.apple.com/hotspot-detect.html'), - timeout: 5.seconds, - ), - ], - useDefaultOptions: false, - ); + }) => InternetConnection.createInstance( + checkInterval: checkInterval, + customCheckOptions: + customCheckOptions ?? + [ + InternetCheckOption( + uri: Uri.parse('https://clients3.google.com/generate_204'), + timeout: 5.seconds, + ), + InternetCheckOption( + uri: Uri.parse('https://1.1.1.1/generate_204'), + timeout: 5.seconds, + ), + InternetCheckOption( + uri: Uri.parse('http://www.msftncsi.com/ncsi.txt'), + timeout: 5.seconds, + ), + InternetCheckOption( + uri: Uri.parse('http://captive.apple.com/hotspot-detect.html'), + timeout: 5.seconds, + ), + ], + useDefaultOptions: false, + ); /// Monitors app lifecycle changes to manage the connection status check. /// Resumes listening when the app is in the foreground and stops when the app @@ -108,17 +109,17 @@ class ConnectionStatusController extends ValueNotifier Future checkInternetConnection() async { final bool hasInternetAccess = await _internetConnection.hasInternetAccess; - _handleInternetConnection( - isInternetConnected: hasInternetAccess, - ); + _handleInternetConnection(isInternetConnected: hasInternetAccess); } /// Starts listening to internet connection status changes and updates /// the [ConnectionStatus] value in real-time. Also checks the connection /// status immediately upon starting. - Future listenToConnectionStatus({bool fromLifecycleCallback=false}) async { + Future listenToConnectionStatus({ + bool fromLifecycleCallback = false, + }) async { stopListeningToConnectionStatus(); - if(!fromLifecycleCallback) { + if (!fromLifecycleCallback) { checkInternetConnection(); } _sub = _internetConnection.onStatusChange.listen((event) async { @@ -127,8 +128,9 @@ class ConnectionStatusController extends ValueNotifier ); }); - _connectivitySub = - connectivity.onConnectivityChanged.listen((result) async { + _connectivitySub = connectivity.onConnectivityChanged.listen(( + result, + ) async { if (result.contains(ConnectivityResult.mobile) || result.contains(ConnectivityResult.wifi)) { checkInternetConnection(); diff --git a/lib/src/models/playx_get_navigation_settings.dart b/lib/src/models/playx_get_navigation_settings.dart index 46efd23..d0c6059 100644 --- a/lib/src/models/playx_get_navigation_settings.dart +++ b/lib/src/models/playx_get_navigation_settings.dart @@ -112,11 +112,11 @@ class PlayxGetNavigationSettings { this.initialBinding, this.unknownRoute, this.includeSentryNavigationObserver = true, - }) : useRouter = false, - routeInformationProvider = null, - routeInformationParser = null, - routerDelegate = null, - backButtonDispatcher = null; + }) : useRouter = false, + routeInformationProvider = null, + routeInformationParser = null, + routerDelegate = null, + backButtonDispatcher = null; /// Creates navigation settings for [Router] instead of [Navigator]. /// @@ -138,13 +138,13 @@ class PlayxGetNavigationSettings { this.smartManagement = SmartManagement.full, this.initialBinding, this.navigatorObservers, - }) : useRouter = true, - routes = null, - initialRoute = null, - onGenerateRoute = null, - onGenerateInitialRoutes = null, - onUnknownRoute = null, - unknownRoute = null, - includeSentryNavigationObserver = true, - home = null; + }) : useRouter = true, + routes = null, + initialRoute = null, + onGenerateRoute = null, + onGenerateInitialRoutes = null, + onUnknownRoute = null, + unknownRoute = null, + includeSentryNavigationObserver = true, + home = null; } diff --git a/lib/src/models/playx_navigation_settings.dart b/lib/src/models/playx_navigation_settings.dart index 8f7ba96..42ea3dc 100644 --- a/lib/src/models/playx_navigation_settings.dart +++ b/lib/src/models/playx_navigation_settings.dart @@ -62,7 +62,6 @@ class PlayxNavigationSettings { /// Indicates whether to use Router-based navigation or GoRouter. final bool useRouter; - /// Creates navigation settings for traditional [Navigator] navigation. /// /// This constructor sets up various properties related to Navigator-based navigation. @@ -77,12 +76,12 @@ class PlayxNavigationSettings { this.navigatorObservers = const [], this.builder, this.includeSentryNavigationObserver = false, - }) : useRouter = false, - routeInformationProvider = null, - routeInformationParser = null, - routerDelegate = null, - goRouter = null, - backButtonDispatcher = null; + }) : useRouter = false, + routeInformationProvider = null, + routeInformationParser = null, + routerDelegate = null, + goRouter = null, + backButtonDispatcher = null; /// Creates navigation settings that use the Router instead of Navigator. /// @@ -94,16 +93,16 @@ class PlayxNavigationSettings { this.backButtonDispatcher, this.navigatorKey, this.builder, - }) : useRouter = true, - routes = null, - initialRoute = null, - onGenerateRoute = null, - onGenerateInitialRoutes = null, - onUnknownRoute = null, - goRouter = null, - home = null, - includeSentryNavigationObserver = false, - navigatorObservers = null; + }) : useRouter = true, + routes = null, + initialRoute = null, + onGenerateRoute = null, + onGenerateInitialRoutes = null, + onUnknownRoute = null, + goRouter = null, + home = null, + includeSentryNavigationObserver = false, + navigatorObservers = null; /// Creates navigation settings that use the GoRouter instead of Navigator. /// @@ -112,17 +111,17 @@ class PlayxNavigationSettings { required GoRouter this.goRouter, this.navigatorKey, this.builder, - }) : useRouter = true, - routes = null, - initialRoute = null, - onGenerateRoute = null, - onGenerateInitialRoutes = null, - onUnknownRoute = null, - routeInformationProvider = null, - routeInformationParser = null, - routerDelegate = null, - backButtonDispatcher = null, - navigatorObservers = null, - includeSentryNavigationObserver = false, - home = null; + }) : useRouter = true, + routes = null, + initialRoute = null, + onGenerateRoute = null, + onGenerateInitialRoutes = null, + onUnknownRoute = null, + routeInformationProvider = null, + routeInformationParser = null, + routerDelegate = null, + backButtonDispatcher = null, + navigatorObservers = null, + includeSentryNavigationObserver = false, + home = null; } diff --git a/lib/src/models/playx_web_settings.dart b/lib/src/models/playx_web_settings.dart index 83ae3ca..eed31ea 100644 --- a/lib/src/models/playx_web_settings.dart +++ b/lib/src/models/playx_web_settings.dart @@ -1,13 +1,13 @@ - /// Settings for Web apps. class PlayxWebSettings { /// Whether to use the path URL strategy for web. final bool usePathUrlStrategy; + /// Whether the URL reflects imperative APIs of GoRouter. final bool optionURLReflectsImperativeAPIs; const PlayxWebSettings({ - this.usePathUrlStrategy =true, - this.optionURLReflectsImperativeAPIs = true, + this.usePathUrlStrategy = true, + this.optionURLReflectsImperativeAPIs = true, }); } diff --git a/lib/src/playx.dart b/lib/src/playx.dart index 16ac494..facd7f5 100644 --- a/lib/src/playx.dart +++ b/lib/src/playx.dart @@ -32,7 +32,8 @@ abstract class Playx { static PlayXAppConfig get appConfig { if (_config == null) { throw Exception( - 'App config not set. Please ensure you have called boot() before accessing the app config.'); + 'App config not set. Please ensure you have called boot() before accessing the app config.', + ); } return _config!; } @@ -65,54 +66,70 @@ abstract class Playx { // Deprecated parameters @Deprecated('Use appConfigBuilder instead.') PlayXAppConfig? appConfig, - @Deprecated('Use localeConfigBuilder instead.') PlayxLocaleConfig? localeConfig, - @Deprecated('Use themeConfigBuilder instead.') PlayxThemeConfig? themeConfig, - @Deprecated('Use envSettingsBuilder instead.') PlayxEnvSettings? envSettings, + @Deprecated('Use localeConfigBuilder instead.') + PlayxLocaleConfig? localeConfig, + @Deprecated('Use themeConfigBuilder instead.') + PlayxThemeConfig? themeConfig, + @Deprecated('Use envSettingsBuilder instead.') + PlayxEnvSettings? envSettings, // Other parameters (unchanged) - PlayxSecurePrefsSettings securePrefsSettings = const PlayxSecurePrefsSettings(), + PlayxSecurePrefsSettings securePrefsSettings = + const PlayxSecurePrefsSettings(), PlayxPrefsSettings prefsSettings = const PlayxPrefsSettings(), WorkManagerSettings workManagerSettings = const WorkManagerSettings(), PlayxWebSettings webSettings = const PlayxWebSettings(), }) async { - WidgetsFlutterBinding.ensureInitialized(); assert( - (appConfigBuilder != null && appConfig == null) || (appConfigBuilder == null && appConfig != null) || (appConfigBuilder == null && appConfig == null), - 'Use either appConfigBuilder or appConfig, not both.' + (appConfigBuilder != null && appConfig == null) || + (appConfigBuilder == null && appConfig != null) || + (appConfigBuilder == null && appConfig == null), + 'Use either appConfigBuilder or appConfig, not both.', ); assert( - (localeConfigBuilder != null && localeConfig == null) || (localeConfigBuilder == null && localeConfig != null) || (localeConfigBuilder == null && localeConfig == null), - 'Use either localeConfigBuilder or localeConfig, not both.' + (localeConfigBuilder != null && localeConfig == null) || + (localeConfigBuilder == null && localeConfig != null) || + (localeConfigBuilder == null && localeConfig == null), + 'Use either localeConfigBuilder or localeConfig, not both.', ); assert( - (themeConfigBuilder != null && themeConfig == null) || (themeConfigBuilder == null && themeConfig != null) || (themeConfigBuilder == null && themeConfig == null), - 'Use either themeConfigBuilder or themeConfig, not both.' + (themeConfigBuilder != null && themeConfig == null) || + (themeConfigBuilder == null && themeConfig != null) || + (themeConfigBuilder == null && themeConfig == null), + 'Use either themeConfigBuilder or themeConfig, not both.', ); assert( - (envSettingsBuilder != null && envSettings == null) || (envSettingsBuilder == null && envSettings != null), - 'Use either envSettingsBuilder or envSettings, not both.' + (envSettingsBuilder != null && envSettings == null) || + (envSettingsBuilder == null && envSettings != null), + 'Use either envSettingsBuilder or envSettings, not both.', ); final envSettingsInstance = envSettingsBuilder?.call() ?? envSettings; - final logger= PlayxLogger.initLogger(name: 'playx', setAsDefault: false, useColoredFormatter: true); + final logger = PlayxLogger.initLogger( + name: 'playx', + setAsDefault: false, + useColoredFormatter: true, + ); await PlayxCore.bootCore( - securePrefsSettings: securePrefsSettings, - envSettings: envSettingsInstance, - prefsSettings: prefsSettings, - workerManagerSettings: workManagerSettings); + securePrefsSettings: securePrefsSettings, + envSettings: envSettingsInstance, + prefsSettings: prefsSettings, + workerManagerSettings: workManagerSettings, + ); logger.i('Core booted ✔'); - final localeConfigInstance = localeConfigBuilder?.call() ?? localeConfig!; await PlayxLocalization.boot(config: localeConfigInstance); final themeConfigInstance = themeConfigBuilder?.call() ?? themeConfig!; + /// Boot the theme configuration. await PlayxTheme.boot(config: themeConfigInstance); logger.i('Theme booted ✔'); final appConfigInstance = appConfigBuilder?.call() ?? appConfig!; + /// Boot the app configuration. await appConfigInstance.boot(); logger.i('AppConfig booted ✔'); @@ -120,7 +137,8 @@ abstract class Playx { /// Set up web navigation settings. PlayxNavigation.setupWeb( usePathUrlStrategy: webSettings.usePathUrlStrategy, - optionURLReflectsImperativeAPIs: webSettings.optionURLReflectsImperativeAPIs, + optionURLReflectsImperativeAPIs: + webSettings.optionURLReflectsImperativeAPIs, ); /// Boot long-running tasks asynchronously. @@ -139,7 +157,7 @@ abstract class Playx { /// [envSettingsBuilder]: A function that returns optional environment settings. /// [sentryOptions]: Optional Sentry configuration for crash reporting. static Future runPlayx({ - required Widget app, + required Widget app, PlayxAppConfigBuilder? appConfigBuilder, PlayxLocaleConfigBuilder? localeConfigBuilder, PlayxThemeConfigBuilder? themeConfigBuilder, @@ -152,26 +170,35 @@ abstract class Playx { PlayxWebSettings webSettings = const PlayxWebSettings(), // Deprecated parameters @Deprecated('Use appConfigBuilder instead.') PlayXAppConfig? appConfig, - @Deprecated('Use localeConfigBuilder instead.') PlayxLocaleConfig? localeConfig, - @Deprecated('Use themeConfigBuilder instead.') PlayxThemeConfig? themeConfig, - @Deprecated('Use envSettingsBuilder instead.') PlayxEnvSettings? envSettings, - + @Deprecated('Use localeConfigBuilder instead.') + PlayxLocaleConfig? localeConfig, + @Deprecated('Use themeConfigBuilder instead.') + PlayxThemeConfig? themeConfig, + @Deprecated('Use envSettingsBuilder instead.') + PlayxEnvSettings? envSettings, }) async { assert( - (appConfigBuilder != null && appConfig == null) || (appConfigBuilder == null && appConfig != null) || (appConfigBuilder == null && appConfig == null), - 'Use either appConfigBuilder or appConfig, not both.' + (appConfigBuilder != null && appConfig == null) || + (appConfigBuilder == null && appConfig != null) || + (appConfigBuilder == null && appConfig == null), + 'Use either appConfigBuilder or appConfig, not both.', ); assert( - (localeConfigBuilder != null && localeConfig == null) || (localeConfigBuilder == null && localeConfig != null) || (localeConfigBuilder == null && localeConfig == null), - 'Use either localeConfigBuilder or localeConfig, not both.' + (localeConfigBuilder != null && localeConfig == null) || + (localeConfigBuilder == null && localeConfig != null) || + (localeConfigBuilder == null && localeConfig == null), + 'Use either localeConfigBuilder or localeConfig, not both.', ); assert( - (themeConfigBuilder != null && themeConfig == null) || (themeConfigBuilder == null && themeConfig != null) || (themeConfigBuilder == null && themeConfig == null), - 'Use either themeConfigBuilder or themeConfig, not both.' + (themeConfigBuilder != null && themeConfig == null) || + (themeConfigBuilder == null && themeConfig != null) || + (themeConfigBuilder == null && themeConfig == null), + 'Use either themeConfigBuilder or themeConfig, not both.', ); assert( - (envSettingsBuilder != null && envSettings == null) || (envSettingsBuilder == null && envSettings != null), - 'Use either envSettingsBuilder or envSettings, not both.' + (envSettingsBuilder != null && envSettings == null) || + (envSettingsBuilder == null && envSettings != null), + 'Use either envSettingsBuilder or envSettings, not both.', ); // Boots Playx dependencies. @@ -194,7 +221,7 @@ abstract class Playx { await SentryFlutter.init( sentryOptions, // Run the app after initializing Sentry. - appRunner: ()=> runApp(app), + appRunner: () => runApp(app), ); } else { runApp(app); diff --git a/lib/src/utils/is_equal_validation.dart b/lib/src/utils/is_equal_validation.dart index 974a9f8..f68d3ef 100644 --- a/lib/src/utils/is_equal_validation.dart +++ b/lib/src/utils/is_equal_validation.dart @@ -7,11 +7,11 @@ class IsEqual extends TextValidationRule { bool caseSensitive; String errorMsg; - IsEqual( - {required this.other, - this.errorMsg = 'There is no match', - this.caseSensitive = true}) - : super(errorMsg); + IsEqual({ + required this.other, + this.errorMsg = 'There is no match', + this.caseSensitive = true, + }) : super(errorMsg); /// return a bool Either valid or NOT @override @@ -22,8 +22,4 @@ class IsEqual extends TextValidationRule { } } -bool _match( - String input, - String other, -) => - input == other; +bool _match(String input, String other) => input == other; diff --git a/lib/src/widgets/getx/get_platform_app.dart b/lib/src/widgets/getx/get_platform_app.dart index 8bf0f2f..888eaac 100644 --- a/lib/src/widgets/getx/get_platform_app.dart +++ b/lib/src/widgets/getx/get_platform_app.dart @@ -320,11 +320,11 @@ class GetPlatformApp this.getPages, this.unknownRoute, this.cupertinoTheme, - }) : _useRouter = false, - routeInformationProvider = null, - routeInformationParser = null, - routerDelegate = null, - backButtonDispatcher = null; + }) : _useRouter = false, + routeInformationProvider = null, + routeInformationParser = null, + routerDelegate = null, + backButtonDispatcher = null; const GetPlatformApp.router({ super.key, @@ -376,14 +376,14 @@ class GetPlatformApp this.routerDelegate, this.backButtonDispatcher, this.cupertinoTheme, - }) : _useRouter = true, - navigatorKey = null, - onGenerateRoute = null, - home = null, - onGenerateInitialRoutes = null, - onUnknownRoute = null, - routes = null, - initialRoute = null, - navigatorObservers = null, - unknownRoute = null; + }) : _useRouter = true, + navigatorKey = null, + onGenerateRoute = null, + home = null, + onGenerateInitialRoutes = null, + onUnknownRoute = null, + routes = null, + initialRoute = null, + navigatorObservers = null, + unknownRoute = null; } diff --git a/lib/src/widgets/getx/playx_material_app.dart b/lib/src/widgets/getx/playx_material_app.dart index 971a3cc..6b6a264 100644 --- a/lib/src/widgets/getx/playx_material_app.dart +++ b/lib/src/widgets/getx/playx_material_app.dart @@ -11,8 +11,6 @@ import 'package:sentry_flutter/sentry_flutter.dart'; import '../../models/playx_get_navigation_settings.dart'; - - /// [PlayxGetMaterialApp] is a widget that integrates [GetMaterialApp] with [PlayXThemeBuilder] and [ScreenUtilInit]. /// /// This widget allows for configuration of theme settings, screen settings, and navigation settings. It also @@ -56,9 +54,7 @@ class PlayxGetMaterialApp extends StatelessWidget { const PlayxGetMaterialApp({ super.key, - this.preferredOrientations = const [ - DeviceOrientation.portraitUp, - ], + this.preferredOrientations = const [DeviceOrientation.portraitUp], this.screenSettings = const PlayxScreenSettings(), this.themeSettings = const PlayxThemeSettings(), this.navigationSettings = const PlayxGetNavigationSettings(), @@ -77,14 +73,15 @@ class PlayxGetMaterialApp extends StatelessWidget { @override Widget build(BuildContext context) { - return PlayxThemeBuilder(builder: (ctx, xTheme) { - // Trigger the theme change callback if provided. - themeSettings.onThemeChanged?.call(xTheme); + return PlayxThemeBuilder( + builder: (ctx, xTheme) { + // Trigger the theme change callback if provided. + themeSettings.onThemeChanged?.call(xTheme); - // Set the preferred orientations for the app. - SystemChrome.setPreferredOrientations(preferredOrientations); + // Set the preferred orientations for the app. + SystemChrome.setPreferredOrientations(preferredOrientations); - return ScreenUtilInit( + return ScreenUtilInit( designSize: screenSettings.designSize, minTextAdapt: screenSettings.minTextAdapt, splitScreenMode: screenSettings.splitScreenMode, @@ -94,138 +91,152 @@ class PlayxGetMaterialApp extends StatelessWidget { responsiveWidgets: screenSettings.responsiveWidgets, ensureScreenSize: screenSettings.ensureScreenSize, builder: (context, child) { - return PlayxLocalizationBuilder(builder: (ctx, locale) { - // Return a GetMaterialApp with router capabilities or standard GetMaterialApp based on settings. - return navigationSettings.useRouter - ? GetMaterialApp.router( - theme: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - debugShowCheckedModeBanner: - appSettings.debugShowCheckedModeBanner, - routeInformationProvider: - navigationSettings.routeInformationProvider, - routerDelegate: navigationSettings.routerDelegate, - routeInformationParser: - navigationSettings.routeInformationParser, - backButtonDispatcher: - navigationSettings.backButtonDispatcher, - navigatorObservers: - navigationSettings.navigatorObservers ?? - [ - if (navigationSettings - .includeSentryNavigationObserver) - SentryNavigatorObserver(), - ], - scaffoldMessengerKey: scaffoldMessengerKey, - builder: navigationSettings.builder, - textDirection: textDirection, - title: title, - onGenerateTitle: onGenerateTitle, - color: color, - darkTheme: themeSettings.darkTheme, - themeMode: themeSettings.themeMode, - supportedLocales: PlayxLocalization.supportedLocales, - localizationsDelegates: - PlayxLocalization.localizationDelegates, - locale: locale.locale, - debugShowMaterialGrid: appSettings.debugShowMaterialGrid, - showPerformanceOverlay: - appSettings.showPerformanceOverlay, - checkerboardRasterCacheImages: - appSettings.checkerboardRasterCacheImages, - checkerboardOffscreenLayers: - appSettings.checkerboardOffscreenLayers, - showSemanticsDebugger: appSettings.showSemanticsDebugger, - shortcuts: appSettings.shortcuts, - scrollBehavior: appSettings.scrollBehavior, - customTransition: navigationSettings.customTransition, - onInit: onInit, - onReady: onReady, - onDispose: onDispose, - routingCallback: navigationSettings.routingCallback, - defaultTransition: navigationSettings.defaultTransition, - getPages: navigationSettings.getPages, - opaqueRoute: navigationSettings.opaqueRoute, - enableLog: appSettings.enableLog, - logWriterCallback: logWriterCallback, - popGesture: popGesture, - transitionDuration: navigationSettings.transitionDuration, - defaultGlobalState: navigationSettings.defaultGlobalState, - smartManagement: navigationSettings.smartManagement, - initialBinding: navigationSettings.initialBinding, - unknownRoute: navigationSettings.unknownRoute, - highContrastTheme: themeSettings.highContrastTheme, - highContrastDarkTheme: - themeSettings.highContrastDarkTheme, - actions: appSettings.actions, - ) - : GetMaterialApp( - theme: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - debugShowCheckedModeBanner: - appSettings.debugShowCheckedModeBanner, - navigatorObservers: - navigationSettings.navigatorObservers ?? - [ - if (navigationSettings - .includeSentryNavigationObserver) - SentryNavigatorObserver(), - ], - navigatorKey: navigationSettings.navigatorKey, - scaffoldMessengerKey: scaffoldMessengerKey, - home: navigationSettings.home, - routes: navigationSettings.routes ?? {}, - initialRoute: navigationSettings.initialRoute, - onGenerateRoute: navigationSettings.onGenerateRoute, - onGenerateInitialRoutes: - navigationSettings.onGenerateInitialRoutes, - onUnknownRoute: navigationSettings.onUnknownRoute, - builder: navigationSettings.builder, - textDirection: textDirection, - title: title, - onGenerateTitle: onGenerateTitle, - color: color, - darkTheme: themeSettings.darkTheme, - themeMode: themeSettings.themeMode, - supportedLocales: PlayxLocalization.supportedLocales, - localizationsDelegates: - PlayxLocalization.localizationDelegates, - locale: locale.locale, - debugShowMaterialGrid: appSettings.debugShowMaterialGrid, - showPerformanceOverlay: - appSettings.showPerformanceOverlay, - checkerboardRasterCacheImages: - appSettings.checkerboardRasterCacheImages, - checkerboardOffscreenLayers: - appSettings.checkerboardOffscreenLayers, - showSemanticsDebugger: appSettings.showSemanticsDebugger, - shortcuts: appSettings.shortcuts, - scrollBehavior: appSettings.scrollBehavior, - customTransition: navigationSettings.customTransition, - onInit: onInit, - onReady: onReady, - onDispose: onDispose, - routingCallback: navigationSettings.routingCallback, - defaultTransition: navigationSettings.defaultTransition, - getPages: navigationSettings.getPages, - opaqueRoute: navigationSettings.opaqueRoute, - enableLog: appSettings.enableLog, - logWriterCallback: logWriterCallback, - popGesture: popGesture, - transitionDuration: navigationSettings.transitionDuration, - defaultGlobalState: navigationSettings.defaultGlobalState, - smartManagement: navigationSettings.smartManagement, - initialBinding: navigationSettings.initialBinding, - unknownRoute: navigationSettings.unknownRoute, - highContrastTheme: themeSettings.highContrastTheme, - highContrastDarkTheme: - themeSettings.highContrastDarkTheme, - actions: appSettings.actions, - ); - }); - }); - }); + return PlayxLocalizationBuilder( + builder: (ctx, locale) { + // Return a GetMaterialApp with router capabilities or standard GetMaterialApp based on settings. + return navigationSettings.useRouter + ? GetMaterialApp.router( + theme: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + debugShowCheckedModeBanner: + appSettings.debugShowCheckedModeBanner, + routeInformationProvider: + navigationSettings.routeInformationProvider, + routerDelegate: navigationSettings.routerDelegate, + routeInformationParser: + navigationSettings.routeInformationParser, + backButtonDispatcher: + navigationSettings.backButtonDispatcher, + navigatorObservers: + navigationSettings.navigatorObservers ?? + [ + if (navigationSettings + .includeSentryNavigationObserver) + SentryNavigatorObserver(), + ], + scaffoldMessengerKey: scaffoldMessengerKey, + builder: navigationSettings.builder, + textDirection: textDirection, + title: title, + onGenerateTitle: onGenerateTitle, + color: color, + darkTheme: themeSettings.darkTheme, + themeMode: themeSettings.themeMode, + supportedLocales: PlayxLocalization.supportedLocales, + localizationsDelegates: + PlayxLocalization.localizationDelegates, + locale: locale.locale, + debugShowMaterialGrid: + appSettings.debugShowMaterialGrid, + showPerformanceOverlay: + appSettings.showPerformanceOverlay, + checkerboardRasterCacheImages: + appSettings.checkerboardRasterCacheImages, + checkerboardOffscreenLayers: + appSettings.checkerboardOffscreenLayers, + showSemanticsDebugger: + appSettings.showSemanticsDebugger, + shortcuts: appSettings.shortcuts, + scrollBehavior: appSettings.scrollBehavior, + customTransition: navigationSettings.customTransition, + onInit: onInit, + onReady: onReady, + onDispose: onDispose, + routingCallback: navigationSettings.routingCallback, + defaultTransition: navigationSettings.defaultTransition, + getPages: navigationSettings.getPages, + opaqueRoute: navigationSettings.opaqueRoute, + enableLog: appSettings.enableLog, + logWriterCallback: logWriterCallback, + popGesture: popGesture, + transitionDuration: + navigationSettings.transitionDuration, + defaultGlobalState: + navigationSettings.defaultGlobalState, + smartManagement: navigationSettings.smartManagement, + initialBinding: navigationSettings.initialBinding, + unknownRoute: navigationSettings.unknownRoute, + highContrastTheme: themeSettings.highContrastTheme, + highContrastDarkTheme: + themeSettings.highContrastDarkTheme, + actions: appSettings.actions, + ) + : GetMaterialApp( + theme: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + debugShowCheckedModeBanner: + appSettings.debugShowCheckedModeBanner, + navigatorObservers: + navigationSettings.navigatorObservers ?? + [ + if (navigationSettings + .includeSentryNavigationObserver) + SentryNavigatorObserver(), + ], + navigatorKey: navigationSettings.navigatorKey, + scaffoldMessengerKey: scaffoldMessengerKey, + home: navigationSettings.home, + routes: navigationSettings.routes ?? {}, + initialRoute: navigationSettings.initialRoute, + onGenerateRoute: navigationSettings.onGenerateRoute, + onGenerateInitialRoutes: + navigationSettings.onGenerateInitialRoutes, + onUnknownRoute: navigationSettings.onUnknownRoute, + builder: navigationSettings.builder, + textDirection: textDirection, + title: title, + onGenerateTitle: onGenerateTitle, + color: color, + darkTheme: themeSettings.darkTheme, + themeMode: themeSettings.themeMode, + supportedLocales: PlayxLocalization.supportedLocales, + localizationsDelegates: + PlayxLocalization.localizationDelegates, + locale: locale.locale, + debugShowMaterialGrid: + appSettings.debugShowMaterialGrid, + showPerformanceOverlay: + appSettings.showPerformanceOverlay, + checkerboardRasterCacheImages: + appSettings.checkerboardRasterCacheImages, + checkerboardOffscreenLayers: + appSettings.checkerboardOffscreenLayers, + showSemanticsDebugger: + appSettings.showSemanticsDebugger, + shortcuts: appSettings.shortcuts, + scrollBehavior: appSettings.scrollBehavior, + customTransition: navigationSettings.customTransition, + onInit: onInit, + onReady: onReady, + onDispose: onDispose, + routingCallback: navigationSettings.routingCallback, + defaultTransition: navigationSettings.defaultTransition, + getPages: navigationSettings.getPages, + opaqueRoute: navigationSettings.opaqueRoute, + enableLog: appSettings.enableLog, + logWriterCallback: logWriterCallback, + popGesture: popGesture, + transitionDuration: + navigationSettings.transitionDuration, + defaultGlobalState: + navigationSettings.defaultGlobalState, + smartManagement: navigationSettings.smartManagement, + initialBinding: navigationSettings.initialBinding, + unknownRoute: navigationSettings.unknownRoute, + highContrastTheme: themeSettings.highContrastTheme, + highContrastDarkTheme: + themeSettings.highContrastDarkTheme, + actions: appSettings.actions, + ); + }, + ); + }, + ); + }, + ); } } diff --git a/lib/src/widgets/getx/playx_platform_app.dart b/lib/src/widgets/getx/playx_platform_app.dart index 185628b..dcd192e 100644 --- a/lib/src/widgets/getx/playx_platform_app.dart +++ b/lib/src/widgets/getx/playx_platform_app.dart @@ -13,7 +13,6 @@ import 'package:sentry_flutter/sentry_flutter.dart'; import '../../models/playx_get_navigation_settings.dart'; - ///PlayxPlatformApp : A widget that wraps [GetMaterialApp] or [ GetCupertinoApp] based on the platform ///with [PlayXThemeBuilder] to update the app with current theme ///and [ScreenUtilInit] that initializes [ScreenUtil] @@ -50,9 +49,7 @@ class PlayxGetPlatformApp extends StatelessWidget { const PlayxGetPlatformApp({ super.key, - this.preferredOrientations = const [ - DeviceOrientation.portraitUp, - ], + this.preferredOrientations = const [DeviceOrientation.portraitUp], this.platformSettings = const PlayxPlatformSettings(), this.screenSettings = const PlayxScreenSettings(), this.themeSettings = const PlayxThemeSettings(), @@ -73,10 +70,11 @@ class PlayxGetPlatformApp extends StatelessWidget { @override Widget build(BuildContext context) { - return PlayxThemeBuilder(builder: (ctx, xTheme) { - themeSettings.onThemeChanged?.call(xTheme); - SystemChrome.setPreferredOrientations(preferredOrientations); - return ScreenUtilInit( + return PlayxThemeBuilder( + builder: (ctx, xTheme) { + themeSettings.onThemeChanged?.call(xTheme); + SystemChrome.setPreferredOrientations(preferredOrientations); + return ScreenUtilInit( designSize: screenSettings.designSize, minTextAdapt: screenSettings.minTextAdapt, splitScreenMode: screenSettings.splitScreenMode, @@ -86,165 +84,180 @@ class PlayxGetPlatformApp extends StatelessWidget { responsiveWidgets: screenSettings.responsiveWidgets, ensureScreenSize: screenSettings.ensureScreenSize, builder: (context, child) { - return PlayxLocalizationBuilder(builder: (ctx, locale) { - return Theme( - data: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - child: PlatformProvider( - initialPlatform: platformSettings.initialPlatform, - settings: PlatformSettingsData( - iosUsesMaterialWidgets: - platformSettings.iosUsesMaterialWidgets, - iosUseZeroPaddingForAppbarPlatformIcon: - platformSettings.iosUseZeroPaddingForAppbarPlatformIcon, - legacyIosUsesMaterialWidgets: false, - platformStyle: platformSettings.platformStyle, - wrapCupertinoAppBarMiddleWithMediaQuery: platformSettings - .wrapCupertinoAppBarMiddleWithMediaQuery, + return PlayxLocalizationBuilder( + builder: (ctx, locale) { + return Theme( + data: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + child: PlatformProvider( + initialPlatform: platformSettings.initialPlatform, + settings: PlatformSettingsData( + iosUsesMaterialWidgets: + platformSettings.iosUsesMaterialWidgets, + iosUseZeroPaddingForAppbarPlatformIcon: platformSettings + .iosUseZeroPaddingForAppbarPlatformIcon, + legacyIosUsesMaterialWidgets: false, + platformStyle: platformSettings.platformStyle, + wrapCupertinoAppBarMiddleWithMediaQuery: platformSettings + .wrapCupertinoAppBarMiddleWithMediaQuery, + ), + builder: (context) => navigationSettings.useRouter + ? GetPlatformApp.router( + theme: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + cupertinoTheme: + themeSettings.cupertinoTheme ?? + xTheme.cupertinoThemeBuilder?.call( + locale.locale, + ) ?? + xTheme.cupertinoThemeData, + debugShowCheckedModeBanner: + appSettings.debugShowCheckedModeBanner, + scaffoldMessengerKey: scaffoldMessengerKey, + routeInformationProvider: + navigationSettings.routeInformationProvider, + routerDelegate: navigationSettings.routerDelegate, + routeInformationParser: + navigationSettings.routeInformationParser, + backButtonDispatcher: + navigationSettings.backButtonDispatcher, + builder: navigationSettings.builder, + textDirection: textDirection, + title: title, + onGenerateTitle: onGenerateTitle, + color: color, + darkTheme: themeSettings.darkTheme, + themeMode: themeSettings.themeMode, + supportedLocales: + PlayxLocalization.supportedLocales, + localizationsDelegates: + PlayxLocalization.localizationDelegates, + locale: PlayxLocalization.currentLocale, + debugShowMaterialGrid: + appSettings.debugShowMaterialGrid, + showPerformanceOverlay: + appSettings.showPerformanceOverlay, + checkerboardRasterCacheImages: + appSettings.checkerboardRasterCacheImages, + checkerboardOffscreenLayers: + appSettings.checkerboardOffscreenLayers, + showSemanticsDebugger: + appSettings.showSemanticsDebugger, + shortcuts: appSettings.shortcuts, + scrollBehavior: appSettings.scrollBehavior, + customTransition: + navigationSettings.customTransition, + onInit: onInit, + onReady: onReady, + onDispose: onDispose, + routingCallback: navigationSettings.routingCallback, + defaultTransition: + navigationSettings.defaultTransition, + getPages: navigationSettings.getPages, + opaqueRoute: navigationSettings.opaqueRoute, + enableLog: appSettings.enableLog, + logWriterCallback: logWriterCallback, + popGesture: popGesture, + transitionDuration: + navigationSettings.transitionDuration, + defaultGlobalState: + navigationSettings.defaultGlobalState, + smartManagement: navigationSettings.smartManagement, + initialBinding: navigationSettings.initialBinding, + highContrastTheme: themeSettings.highContrastTheme, + highContrastDarkTheme: + themeSettings.highContrastDarkTheme, + actions: appSettings.actions, + ) + : GetPlatformApp( + theme: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + cupertinoTheme: + themeSettings.cupertinoTheme ?? + xTheme.cupertinoThemeBuilder?.call( + locale.locale, + ) ?? + xTheme.cupertinoThemeData, + debugShowCheckedModeBanner: + appSettings.debugShowCheckedModeBanner, + navigatorObservers: + navigationSettings.navigatorObservers ?? + [ + if (navigationSettings + .includeSentryNavigationObserver) + SentryNavigatorObserver(), + ], + navigatorKey: navigationSettings.navigatorKey, + scaffoldMessengerKey: scaffoldMessengerKey, + home: home, + routes: navigationSettings.routes, + initialRoute: navigationSettings.initialRoute, + onGenerateRoute: navigationSettings.onGenerateRoute, + onGenerateInitialRoutes: + navigationSettings.onGenerateInitialRoutes, + onUnknownRoute: navigationSettings.onUnknownRoute, + builder: navigationSettings.builder, + textDirection: textDirection, + title: title, + onGenerateTitle: onGenerateTitle, + color: color, + darkTheme: themeSettings.darkTheme, + themeMode: themeSettings.themeMode, + supportedLocales: + PlayxLocalization.supportedLocales, + localizationsDelegates: + PlayxLocalization.localizationDelegates, + locale: PlayxLocalization.currentLocale, + debugShowMaterialGrid: + appSettings.debugShowMaterialGrid, + showPerformanceOverlay: + appSettings.showPerformanceOverlay, + checkerboardRasterCacheImages: + appSettings.checkerboardRasterCacheImages, + checkerboardOffscreenLayers: + appSettings.checkerboardOffscreenLayers, + showSemanticsDebugger: + appSettings.showSemanticsDebugger, + shortcuts: appSettings.shortcuts, + scrollBehavior: appSettings.scrollBehavior, + customTransition: + navigationSettings.customTransition, + onInit: onInit, + onReady: onReady, + onDispose: onDispose, + routingCallback: navigationSettings.routingCallback, + defaultTransition: + navigationSettings.defaultTransition, + getPages: navigationSettings.getPages, + opaqueRoute: navigationSettings.opaqueRoute, + enableLog: appSettings.enableLog, + logWriterCallback: logWriterCallback, + popGesture: popGesture, + transitionDuration: + navigationSettings.transitionDuration, + defaultGlobalState: + navigationSettings.defaultGlobalState, + smartManagement: navigationSettings.smartManagement, + initialBinding: navigationSettings.initialBinding, + unknownRoute: navigationSettings.unknownRoute, + highContrastTheme: themeSettings.highContrastTheme, + highContrastDarkTheme: + themeSettings.highContrastDarkTheme, + actions: appSettings.actions, + ), ), - builder: (context) => navigationSettings.useRouter - ? GetPlatformApp.router( - theme: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - cupertinoTheme: themeSettings.cupertinoTheme ?? - xTheme.cupertinoThemeBuilder - ?.call(locale.locale) ?? - xTheme.cupertinoThemeData, - debugShowCheckedModeBanner: - appSettings.debugShowCheckedModeBanner, - scaffoldMessengerKey: scaffoldMessengerKey, - routeInformationProvider: - navigationSettings.routeInformationProvider, - routerDelegate: navigationSettings.routerDelegate, - routeInformationParser: - navigationSettings.routeInformationParser, - backButtonDispatcher: - navigationSettings.backButtonDispatcher, - builder: navigationSettings.builder, - textDirection: textDirection, - title: title, - onGenerateTitle: onGenerateTitle, - color: color, - darkTheme: themeSettings.darkTheme, - themeMode: themeSettings.themeMode, - supportedLocales: PlayxLocalization.supportedLocales, - localizationsDelegates: - PlayxLocalization.localizationDelegates, - locale: PlayxLocalization.currentLocale, - debugShowMaterialGrid: - appSettings.debugShowMaterialGrid, - showPerformanceOverlay: - appSettings.showPerformanceOverlay, - checkerboardRasterCacheImages: - appSettings.checkerboardRasterCacheImages, - checkerboardOffscreenLayers: - appSettings.checkerboardOffscreenLayers, - showSemanticsDebugger: - appSettings.showSemanticsDebugger, - shortcuts: appSettings.shortcuts, - scrollBehavior: appSettings.scrollBehavior, - customTransition: navigationSettings.customTransition, - onInit: onInit, - onReady: onReady, - onDispose: onDispose, - routingCallback: navigationSettings.routingCallback, - defaultTransition: - navigationSettings.defaultTransition, - getPages: navigationSettings.getPages, - opaqueRoute: navigationSettings.opaqueRoute, - enableLog: appSettings.enableLog, - logWriterCallback: logWriterCallback, - popGesture: popGesture, - transitionDuration: - navigationSettings.transitionDuration, - defaultGlobalState: - navigationSettings.defaultGlobalState, - smartManagement: navigationSettings.smartManagement, - initialBinding: navigationSettings.initialBinding, - highContrastTheme: themeSettings.highContrastTheme, - highContrastDarkTheme: - themeSettings.highContrastDarkTheme, - actions: appSettings.actions, - ) - : GetPlatformApp( - theme: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - cupertinoTheme: themeSettings.cupertinoTheme ?? - xTheme.cupertinoThemeBuilder - ?.call(locale.locale) ?? - xTheme.cupertinoThemeData, - debugShowCheckedModeBanner: - appSettings.debugShowCheckedModeBanner, - navigatorObservers: - navigationSettings.navigatorObservers ?? - [ - if (navigationSettings - .includeSentryNavigationObserver) - SentryNavigatorObserver(), - ], - navigatorKey: navigationSettings.navigatorKey, - scaffoldMessengerKey: scaffoldMessengerKey, - home: home, - routes: navigationSettings.routes, - initialRoute: navigationSettings.initialRoute, - onGenerateRoute: navigationSettings.onGenerateRoute, - onGenerateInitialRoutes: - navigationSettings.onGenerateInitialRoutes, - onUnknownRoute: navigationSettings.onUnknownRoute, - builder: navigationSettings.builder, - textDirection: textDirection, - title: title, - onGenerateTitle: onGenerateTitle, - color: color, - darkTheme: themeSettings.darkTheme, - themeMode: themeSettings.themeMode, - supportedLocales: PlayxLocalization.supportedLocales, - localizationsDelegates: - PlayxLocalization.localizationDelegates, - locale: PlayxLocalization.currentLocale, - debugShowMaterialGrid: - appSettings.debugShowMaterialGrid, - showPerformanceOverlay: - appSettings.showPerformanceOverlay, - checkerboardRasterCacheImages: - appSettings.checkerboardRasterCacheImages, - checkerboardOffscreenLayers: - appSettings.checkerboardOffscreenLayers, - showSemanticsDebugger: - appSettings.showSemanticsDebugger, - shortcuts: appSettings.shortcuts, - scrollBehavior: appSettings.scrollBehavior, - customTransition: navigationSettings.customTransition, - onInit: onInit, - onReady: onReady, - onDispose: onDispose, - routingCallback: navigationSettings.routingCallback, - defaultTransition: - navigationSettings.defaultTransition, - getPages: navigationSettings.getPages, - opaqueRoute: navigationSettings.opaqueRoute, - enableLog: appSettings.enableLog, - logWriterCallback: logWriterCallback, - popGesture: popGesture, - transitionDuration: - navigationSettings.transitionDuration, - defaultGlobalState: - navigationSettings.defaultGlobalState, - smartManagement: navigationSettings.smartManagement, - initialBinding: navigationSettings.initialBinding, - unknownRoute: navigationSettings.unknownRoute, - highContrastTheme: themeSettings.highContrastTheme, - highContrastDarkTheme: - themeSettings.highContrastDarkTheme, - actions: appSettings.actions, - ), - ), - ); - }); - }); - }); + ); + }, + ); + }, + ); + }, + ); } } diff --git a/lib/src/widgets/playx_material_app.dart b/lib/src/widgets/playx_material_app.dart index 8cfb4bf..7326dd8 100644 --- a/lib/src/widgets/playx_material_app.dart +++ b/lib/src/widgets/playx_material_app.dart @@ -49,9 +49,7 @@ class PlayxMaterialApp extends StatelessWidget { /// screen size, theme, navigation, and general app behavior. const PlayxMaterialApp({ super.key, - this.preferredOrientations = const [ - DeviceOrientation.portraitUp, - ], + this.preferredOrientations = const [DeviceOrientation.portraitUp], this.screenSettings = const PlayxScreenSettings(), this.themeSettings = const PlayxThemeSettings(), this.navigationSettings = const PlayxNavigationSettings(), @@ -60,120 +58,140 @@ class PlayxMaterialApp extends StatelessWidget { @override Widget build(BuildContext context) { - return PlayxThemeBuilder(builder: (ctx, xTheme) { - themeSettings.onThemeChanged?.call(xTheme); - SystemChrome.setPreferredOrientations(preferredOrientations); - return ScreenUtilInit( - designSize: screenSettings.designSize, - minTextAdapt: screenSettings.minTextAdapt, - splitScreenMode: screenSettings.splitScreenMode, - useInheritedMediaQuery: screenSettings.useInheritedMediaQuery, - rebuildFactor: screenSettings.rebuildFactor, - fontSizeResolver: screenSettings.fontSizeResolver, - responsiveWidgets: screenSettings.responsiveWidgets, - ensureScreenSize: screenSettings.ensureScreenSize, - builder: (context, child) { - return PlayxLocalizationBuilder(builder: (ctx, locale) { - final materialApp = navigationSettings.useRouter - ? MaterialApp.router( - title: appSettings.title, - theme: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - debugShowCheckedModeBanner: - appSettings.debugShowCheckedModeBanner, - routeInformationProvider: - navigationSettings.goRouter?.routeInformationProvider ?? + return PlayxThemeBuilder( + builder: (ctx, xTheme) { + themeSettings.onThemeChanged?.call(xTheme); + SystemChrome.setPreferredOrientations(preferredOrientations); + return ScreenUtilInit( + designSize: screenSettings.designSize, + minTextAdapt: screenSettings.minTextAdapt, + splitScreenMode: screenSettings.splitScreenMode, + useInheritedMediaQuery: screenSettings.useInheritedMediaQuery, + rebuildFactor: screenSettings.rebuildFactor, + fontSizeResolver: screenSettings.fontSizeResolver, + responsiveWidgets: screenSettings.responsiveWidgets, + ensureScreenSize: screenSettings.ensureScreenSize, + builder: (context, child) { + return PlayxLocalizationBuilder( + builder: (ctx, locale) { + final materialApp = navigationSettings.useRouter + ? MaterialApp.router( + title: appSettings.title, + theme: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + debugShowCheckedModeBanner: + appSettings.debugShowCheckedModeBanner, + routeInformationProvider: + navigationSettings + .goRouter + ?.routeInformationProvider ?? navigationSettings.routeInformationProvider, - routerDelegate: - navigationSettings.goRouter?.routerDelegate ?? + routerDelegate: + navigationSettings.goRouter?.routerDelegate ?? navigationSettings.routerDelegate, - routeInformationParser: - navigationSettings.goRouter?.routeInformationParser ?? + routeInformationParser: + navigationSettings + .goRouter + ?.routeInformationParser ?? navigationSettings.routeInformationParser, - backButtonDispatcher: - navigationSettings.goRouter?.backButtonDispatcher ?? + backButtonDispatcher: + navigationSettings.goRouter?.backButtonDispatcher ?? navigationSettings.backButtonDispatcher, - builder: navigationSettings.builder, - darkTheme: themeSettings.darkTheme, - themeMode: themeSettings.themeMode, - supportedLocales: PlayxLocalization.supportedLocales, - localizationsDelegates: - appSettings.localizationsDelegates == null + builder: navigationSettings.builder, + darkTheme: themeSettings.darkTheme, + themeMode: themeSettings.themeMode, + supportedLocales: PlayxLocalization.supportedLocales, + localizationsDelegates: + appSettings.localizationsDelegates == null ? PlayxLocalization.localizationDelegates : [ ...PlayxLocalization.localizationDelegates, ...appSettings.localizationsDelegates!, ], - locale: locale.locale, - debugShowMaterialGrid: appSettings.debugShowMaterialGrid, - showPerformanceOverlay: appSettings.showPerformanceOverlay, - checkerboardRasterCacheImages: - appSettings.checkerboardRasterCacheImages, - checkerboardOffscreenLayers: - appSettings.checkerboardOffscreenLayers, - showSemanticsDebugger: appSettings.showSemanticsDebugger, - shortcuts: appSettings.shortcuts, - scrollBehavior: appSettings.scrollBehavior, - highContrastTheme: themeSettings.highContrastTheme, - highContrastDarkTheme: themeSettings.highContrastDarkTheme, - actions: appSettings.actions, - ) - : MaterialApp( - title: appSettings.title, - theme: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - debugShowCheckedModeBanner: - appSettings.debugShowCheckedModeBanner, - navigatorObservers: navigationSettings.navigatorObservers ?? - [ - if (navigationSettings - .includeSentryNavigationObserver) - SentryNavigatorObserver(), - ], - navigatorKey: navigationSettings.navigatorKey, - home: navigationSettings.home, - routes: navigationSettings.routes ?? {}, - initialRoute: navigationSettings.initialRoute, - onGenerateRoute: navigationSettings.onGenerateRoute, - onGenerateInitialRoutes: - navigationSettings.onGenerateInitialRoutes, - onUnknownRoute: navigationSettings.onUnknownRoute, - builder: navigationSettings.builder, - darkTheme: themeSettings.darkTheme, - themeMode: themeSettings.themeMode, - supportedLocales: PlayxLocalization.supportedLocales, - localizationsDelegates: - appSettings.localizationsDelegates == null + locale: locale.locale, + debugShowMaterialGrid: + appSettings.debugShowMaterialGrid, + showPerformanceOverlay: + appSettings.showPerformanceOverlay, + checkerboardRasterCacheImages: + appSettings.checkerboardRasterCacheImages, + checkerboardOffscreenLayers: + appSettings.checkerboardOffscreenLayers, + showSemanticsDebugger: + appSettings.showSemanticsDebugger, + shortcuts: appSettings.shortcuts, + scrollBehavior: appSettings.scrollBehavior, + highContrastTheme: themeSettings.highContrastTheme, + highContrastDarkTheme: + themeSettings.highContrastDarkTheme, + actions: appSettings.actions, + ) + : MaterialApp( + title: appSettings.title, + theme: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + debugShowCheckedModeBanner: + appSettings.debugShowCheckedModeBanner, + navigatorObservers: + navigationSettings.navigatorObservers ?? + [ + if (navigationSettings + .includeSentryNavigationObserver) + SentryNavigatorObserver(), + ], + navigatorKey: navigationSettings.navigatorKey, + home: navigationSettings.home, + routes: navigationSettings.routes ?? {}, + initialRoute: navigationSettings.initialRoute, + onGenerateRoute: navigationSettings.onGenerateRoute, + onGenerateInitialRoutes: + navigationSettings.onGenerateInitialRoutes, + onUnknownRoute: navigationSettings.onUnknownRoute, + builder: navigationSettings.builder, + darkTheme: themeSettings.darkTheme, + themeMode: themeSettings.themeMode, + supportedLocales: PlayxLocalization.supportedLocales, + localizationsDelegates: + appSettings.localizationsDelegates == null ? PlayxLocalization.localizationDelegates : [ ...PlayxLocalization.localizationDelegates, ...appSettings.localizationsDelegates!, ], - locale: locale.locale, - debugShowMaterialGrid: appSettings.debugShowMaterialGrid, - showPerformanceOverlay: appSettings.showPerformanceOverlay, - checkerboardRasterCacheImages: - appSettings.checkerboardRasterCacheImages, - checkerboardOffscreenLayers: - appSettings.checkerboardOffscreenLayers, - showSemanticsDebugger: appSettings.showSemanticsDebugger, - shortcuts: appSettings.shortcuts, - scrollBehavior: appSettings.scrollBehavior, - highContrastTheme: themeSettings.highContrastTheme, - highContrastDarkTheme: themeSettings.highContrastDarkTheme, - actions: appSettings.actions, - ); + locale: locale.locale, + debugShowMaterialGrid: + appSettings.debugShowMaterialGrid, + showPerformanceOverlay: + appSettings.showPerformanceOverlay, + checkerboardRasterCacheImages: + appSettings.checkerboardRasterCacheImages, + checkerboardOffscreenLayers: + appSettings.checkerboardOffscreenLayers, + showSemanticsDebugger: + appSettings.showSemanticsDebugger, + shortcuts: appSettings.shortcuts, + scrollBehavior: appSettings.scrollBehavior, + highContrastTheme: themeSettings.highContrastTheme, + highContrastDarkTheme: + themeSettings.highContrastDarkTheme, + actions: appSettings.actions, + ); - return navigationSettings.goRouter != null - ? PlayxNavigationBuilder( - builder: (ctx) => materialApp, - router: navigationSettings.goRouter!) - : materialApp; - }); - }, - ); - }); + return navigationSettings.goRouter != null + ? PlayxNavigationBuilder( + builder: (ctx) => materialApp, + router: navigationSettings.goRouter!, + ) + : materialApp; + }, + ); + }, + ); + }, + ); } } diff --git a/lib/src/widgets/playx_platform_app.dart b/lib/src/widgets/playx_platform_app.dart index bff5119..17c6de0 100644 --- a/lib/src/widgets/playx_platform_app.dart +++ b/lib/src/widgets/playx_platform_app.dart @@ -51,9 +51,7 @@ class PlayxPlatformApp extends StatelessWidget { /// platform-specific widgets, screen size, theme, navigation, and general app behavior. const PlayxPlatformApp({ super.key, - this.preferredOrientations = const [ - DeviceOrientation.portraitUp, - ], + this.preferredOrientations = const [DeviceOrientation.portraitUp], this.platformSettings = const PlayxPlatformSettings(), this.screenSettings = const PlayxScreenSettings(), this.themeSettings = const PlayxThemeSettings(), @@ -63,123 +61,144 @@ class PlayxPlatformApp extends StatelessWidget { @override Widget build(BuildContext context) { - return PlayxThemeBuilder(builder: (ctx, xTheme) { - themeSettings.onThemeChanged?.call(xTheme); - SystemChrome.setPreferredOrientations(preferredOrientations); - return ScreenUtilInit( - designSize: screenSettings.designSize, - minTextAdapt: screenSettings.minTextAdapt, - splitScreenMode: screenSettings.splitScreenMode, - useInheritedMediaQuery: screenSettings.useInheritedMediaQuery, - rebuildFactor: screenSettings.rebuildFactor, - fontSizeResolver: screenSettings.fontSizeResolver, - responsiveWidgets: screenSettings.responsiveWidgets, - ensureScreenSize: screenSettings.ensureScreenSize, - builder: (context, child) { - return PlayxLocalizationBuilder(builder: (ctx, locale) { - final platformApp = navigationSettings.useRouter - ? PlatformApp.router( - debugShowCheckedModeBanner: - appSettings.debugShowCheckedModeBanner, - routeInformationProvider: - navigationSettings.goRouter?.routeInformationProvider ?? + return PlayxThemeBuilder( + builder: (ctx, xTheme) { + themeSettings.onThemeChanged?.call(xTheme); + SystemChrome.setPreferredOrientations(preferredOrientations); + return ScreenUtilInit( + designSize: screenSettings.designSize, + minTextAdapt: screenSettings.minTextAdapt, + splitScreenMode: screenSettings.splitScreenMode, + useInheritedMediaQuery: screenSettings.useInheritedMediaQuery, + rebuildFactor: screenSettings.rebuildFactor, + fontSizeResolver: screenSettings.fontSizeResolver, + responsiveWidgets: screenSettings.responsiveWidgets, + ensureScreenSize: screenSettings.ensureScreenSize, + builder: (context, child) { + return PlayxLocalizationBuilder( + builder: (ctx, locale) { + final platformApp = navigationSettings.useRouter + ? PlatformApp.router( + debugShowCheckedModeBanner: + appSettings.debugShowCheckedModeBanner, + routeInformationProvider: + navigationSettings + .goRouter + ?.routeInformationProvider ?? navigationSettings.routeInformationProvider, - routerDelegate: - navigationSettings.goRouter?.routerDelegate ?? + routerDelegate: + navigationSettings.goRouter?.routerDelegate ?? navigationSettings.routerDelegate, - routeInformationParser: - navigationSettings.goRouter?.routeInformationParser ?? + routeInformationParser: + navigationSettings + .goRouter + ?.routeInformationParser ?? navigationSettings.routeInformationParser, - backButtonDispatcher: - navigationSettings.goRouter?.backButtonDispatcher ?? + backButtonDispatcher: + navigationSettings.goRouter?.backButtonDispatcher ?? navigationSettings.backButtonDispatcher, - builder: navigationSettings.builder, - supportedLocales: PlayxLocalization.supportedLocales, - localizationsDelegates: - appSettings.localizationsDelegates == null + builder: navigationSettings.builder, + supportedLocales: PlayxLocalization.supportedLocales, + localizationsDelegates: + appSettings.localizationsDelegates == null ? PlayxLocalization.localizationDelegates : [ ...PlayxLocalization.localizationDelegates, ...appSettings.localizationsDelegates!, ], - locale: locale.locale, - showPerformanceOverlay: appSettings.showPerformanceOverlay, - checkerboardRasterCacheImages: - appSettings.checkerboardRasterCacheImages, - checkerboardOffscreenLayers: - appSettings.checkerboardOffscreenLayers, - showSemanticsDebugger: appSettings.showSemanticsDebugger, - shortcuts: appSettings.shortcuts, - scrollBehavior: appSettings.scrollBehavior, - actions: appSettings.actions, - material: (c, _) => MaterialAppRouterData( - debugShowMaterialGrid: appSettings.debugShowMaterialGrid, - darkTheme: themeSettings.darkTheme, - themeMode: themeSettings.themeMode, - theme: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - ), - ) - : PlatformApp( - debugShowCheckedModeBanner: - appSettings.debugShowCheckedModeBanner, - navigatorObservers: navigationSettings.navigatorObservers ?? - [ - if (navigationSettings - .includeSentryNavigationObserver) - SentryNavigatorObserver(), - ], - navigatorKey: navigationSettings.navigatorKey, - home: navigationSettings.home, - routes: navigationSettings.routes ?? {}, - initialRoute: navigationSettings.initialRoute, - onGenerateRoute: navigationSettings.onGenerateRoute, - onGenerateInitialRoutes: - navigationSettings.onGenerateInitialRoutes, - onUnknownRoute: navigationSettings.onUnknownRoute, - builder: navigationSettings.builder, - supportedLocales: PlayxLocalization.supportedLocales, - localizationsDelegates: - appSettings.localizationsDelegates == null + locale: locale.locale, + showPerformanceOverlay: + appSettings.showPerformanceOverlay, + checkerboardRasterCacheImages: + appSettings.checkerboardRasterCacheImages, + checkerboardOffscreenLayers: + appSettings.checkerboardOffscreenLayers, + showSemanticsDebugger: + appSettings.showSemanticsDebugger, + shortcuts: appSettings.shortcuts, + scrollBehavior: appSettings.scrollBehavior, + actions: appSettings.actions, + material: (c, _) => MaterialAppRouterData( + debugShowMaterialGrid: + appSettings.debugShowMaterialGrid, + darkTheme: themeSettings.darkTheme, + themeMode: themeSettings.themeMode, + theme: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + ), + ) + : PlatformApp( + debugShowCheckedModeBanner: + appSettings.debugShowCheckedModeBanner, + navigatorObservers: + navigationSettings.navigatorObservers ?? + [ + if (navigationSettings + .includeSentryNavigationObserver) + SentryNavigatorObserver(), + ], + navigatorKey: navigationSettings.navigatorKey, + home: navigationSettings.home, + routes: navigationSettings.routes ?? {}, + initialRoute: navigationSettings.initialRoute, + onGenerateRoute: navigationSettings.onGenerateRoute, + onGenerateInitialRoutes: + navigationSettings.onGenerateInitialRoutes, + onUnknownRoute: navigationSettings.onUnknownRoute, + builder: navigationSettings.builder, + supportedLocales: PlayxLocalization.supportedLocales, + localizationsDelegates: + appSettings.localizationsDelegates == null ? PlayxLocalization.localizationDelegates : [ ...PlayxLocalization.localizationDelegates, ...appSettings.localizationsDelegates!, ], - locale: locale.locale, - showPerformanceOverlay: appSettings.showPerformanceOverlay, - checkerboardRasterCacheImages: - appSettings.checkerboardRasterCacheImages, - checkerboardOffscreenLayers: - appSettings.checkerboardOffscreenLayers, - showSemanticsDebugger: appSettings.showSemanticsDebugger, - shortcuts: appSettings.shortcuts, - scrollBehavior: appSettings.scrollBehavior, - actions: appSettings.actions, - material: (c, _) => MaterialAppData( - debugShowMaterialGrid: appSettings.debugShowMaterialGrid, - darkTheme: themeSettings.darkTheme, - themeMode: themeSettings.themeMode, - theme: themeSettings.theme ?? - xTheme.themeBuilder?.call(locale.locale) ?? - xTheme.themeData, - ), - cupertino: (c, _) => CupertinoAppData( - theme: themeSettings.cupertinoTheme ?? - xTheme.cupertinoThemeBuilder?.call(locale.locale) ?? - xTheme.cupertinoThemeData, - ), - ); + locale: locale.locale, + showPerformanceOverlay: + appSettings.showPerformanceOverlay, + checkerboardRasterCacheImages: + appSettings.checkerboardRasterCacheImages, + checkerboardOffscreenLayers: + appSettings.checkerboardOffscreenLayers, + showSemanticsDebugger: + appSettings.showSemanticsDebugger, + shortcuts: appSettings.shortcuts, + scrollBehavior: appSettings.scrollBehavior, + actions: appSettings.actions, + material: (c, _) => MaterialAppData( + debugShowMaterialGrid: + appSettings.debugShowMaterialGrid, + darkTheme: themeSettings.darkTheme, + themeMode: themeSettings.themeMode, + theme: + themeSettings.theme ?? + xTheme.themeBuilder?.call(locale.locale) ?? + xTheme.themeData, + ), + cupertino: (c, _) => CupertinoAppData( + theme: + themeSettings.cupertinoTheme ?? + xTheme.cupertinoThemeBuilder?.call( + locale.locale, + ) ?? + xTheme.cupertinoThemeData, + ), + ); - return navigationSettings.goRouter != null - ? PlayxNavigationBuilder( - builder: (ctx) => platformApp, - router: navigationSettings.goRouter!) - : platformApp; - }); - }, - ); - }); + return navigationSettings.goRouter != null + ? PlayxNavigationBuilder( + builder: (ctx) => platformApp, + router: navigationSettings.goRouter!, + ) + : platformApp; + }, + ); + }, + ); + }, + ); } } From 212b3d77c237d24280e0568dacde5589524df4e8 Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 16:08:50 +0300 Subject: [PATCH 08/12] refactor: code cleanup --- .flutter-plugins | 10 ---------- .flutter-plugins-dependencies | 1 - .gitignore | 2 ++ 3 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 .flutter-plugins delete mode 100644 .flutter-plugins-dependencies diff --git a/.flutter-plugins b/.flutter-plugins deleted file mode 100644 index f18e66c..0000000 --- a/.flutter-plugins +++ /dev/null @@ -1,10 +0,0 @@ -# This is a generated file; do not edit or check into version control. -path_provider_linux=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-2.1.7\\ -path_provider_windows=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-2.1.3\\ -shared_preferences=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences-2.0.15\\ -shared_preferences_android=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_android-2.0.14\\ -shared_preferences_ios=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_ios-2.1.1\\ -shared_preferences_linux=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_linux-2.1.2\\ -shared_preferences_macos=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_macos-2.0.4\\ -shared_preferences_web=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_web-2.0.4\\ -shared_preferences_windows=C:\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_windows-2.1.2\\ diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies deleted file mode 100644 index 4bac593..0000000 --- a/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_temp_fork","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_temp_fork-0.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus"],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sqflite_darwin-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_temp_fork","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_temp_fork-0.1.5/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/jni-0.14.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/path_provider_android-2.2.17/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus","jni"],"dev_dependency":false},{"name":"shared_preferences_android","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.10/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_android","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sqflite_android-2.4.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_macos","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_macos-1.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_macos","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus"],"dev_dependency":false},{"name":"shared_preferences_foundation","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sqflite_darwin-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_linux","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_linux-1.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/jni-0.14.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus","jni"],"dev_dependency":false}],"windows":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_windows","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_windows-1.0.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"jni","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/jni-0.14.1/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","native_build":true,"dependencies":["package_info_plus","jni"],"dev_dependency":false}],"web":[{"name":"connectivity_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.4/","dependencies":[],"dev_dependency":false},{"name":"flutter_keyboard_visibility_temp_fork","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility_temp_fork-0.1.5/","dependencies":[],"dev_dependency":false},{"name":"flutter_secure_storage_web","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false},{"name":"package_info_plus","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/package_info_plus-8.3.0/","dependencies":[],"dev_dependency":false},{"name":"sentry_flutter","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/sentry_flutter-9.2.0/","dependencies":["package_info_plus"],"dev_dependency":false},{"name":"shared_preferences_web","path":"/Users/basemosama/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":[]},{"name":"flutter_keyboard_visibility_linux","dependencies":[]},{"name":"flutter_keyboard_visibility_macos","dependencies":[]},{"name":"flutter_keyboard_visibility_temp_fork","dependencies":["flutter_keyboard_visibility_linux","flutter_keyboard_visibility_macos","flutter_keyboard_visibility_windows"]},{"name":"flutter_keyboard_visibility_windows","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_macos","flutter_secure_storage_web"]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"jni","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"sentry_flutter","dependencies":["package_info_plus","jni"]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_web"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":["sqflite_android","sqflite_darwin"]},{"name":"sqflite_android","dependencies":[]},{"name":"sqflite_darwin","dependencies":[]}],"date_created":"2025-07-02 14:56:49.799620","version":"3.32.5","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 96486fd..5c5c63d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ migrate_working_dir/ .dart_tool/ .packages build/ +.flutter-plugins-dependencies +.flutter-plugins From 3e4290bb09599c8cb6ea4553b2204b6599ee08dd Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 16:11:21 +0300 Subject: [PATCH 09/12] chore: Update changelog for version 1.5.0 with SDK updates, connection status enhancements, and project maintenance --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9608cf0..5f168ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,40 @@ # Changelog +## 1.5.0 + +### SDK & Dependency Updates + +* Updated SDK constraints: + + * Dart: `>=3.8.0 <4.0.0` + * Flutter: `>=3.32.0` +* Upgraded dependencies: + + * `async: ^2.13.0` + * `playx_core: ^0.7.3` + * `playx_theme: ^1.1.0` + * `playx_widget: ^0.3.0` + * `playx_network: ^0.5.0` + * `playx_navigation: ^0.2.0` + * `playx_localization: ^0.3.0` + * `sentry_flutter: ^9.2.0` + * `internet_connection_checker_plus: ^2.7.2` + * `connectivity_plus: ^6.1.4` + +### Connection Status Enhancements + +* Improved `ConnectionStatusController`: + + * Replaced default internet check URLs with more reliable ones. + * Added `backOnlineDelay` to control delay after reconnection. + * Skipped unnecessary checks on app resume. + +### Project Maintenance + +* Migrated example project’s Android build files to **Kotlin DSL (`.kts`)**. +* Upgraded example project dependencies for compatibility. + + ## 1.4.1 - Update packages. From ff80c125401dedbee6215f3c2ee98b843a2840ca Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 16:12:04 +0300 Subject: [PATCH 10/12] chore: Update playx_network dependency to version 0.5.1 in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f168ef..788a821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ * `playx_core: ^0.7.3` * `playx_theme: ^1.1.0` * `playx_widget: ^0.3.0` - * `playx_network: ^0.5.0` + * `playx_network: ^0.5.1` * `playx_navigation: ^0.2.0` * `playx_localization: ^0.3.0` * `sentry_flutter: ^9.2.0` From 2aa3ceec92874197e192f2f7115386c51c4684e7 Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 16:14:49 +0300 Subject: [PATCH 11/12] ci: Update test workflow to include code formatting and dry-run publish step --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee601fe..d308572 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,11 +16,14 @@ jobs: run: flutter packages get - name: Format code - run: dart format --fix + run: dart format . - name: Analyze Code run: flutter analyze lib test example + - name: Test Publish + run: dart pub publish --dry-run + - name: Test run: flutter test --coverage From 37a2efe6e6f0df7232464f8e51b0a6ebec8bf127 Mon Sep 17 00:00:00 2001 From: basemosama Date: Wed, 2 Jul 2025 16:15:10 +0300 Subject: [PATCH 12/12] ci: Update test workflow to include code formatting and dry-run publish step --- lib/src/widgets/getx/get_platform_app.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/widgets/getx/get_platform_app.dart b/lib/src/widgets/getx/get_platform_app.dart index 888eaac..1beb4f4 100644 --- a/lib/src/widgets/getx/get_platform_app.dart +++ b/lib/src/widgets/getx/get_platform_app.dart @@ -1,7 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:playx/playx.dart' hide TextDirection; +import 'package:playx/playx.dart'; /// A widget that represents [GetMaterialApp] for Android or Material platforms /// and [GetCupertinoApp] for iOS devices or Cupertino platforms.\