diff --git a/example/.metadata b/example/.metadata index 8973d6ca..706ff779 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: "761747bfc538b5af34aa0d3fac380f1bc331ec49" + revision: "603104015dd692ea3403755b55d07813d5cf8965" channel: "stable" project_type: app @@ -13,11 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 - base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - platform: android - create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 - base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 # User provided section diff --git a/example/android/.gitignore b/example/android/.gitignore index 6f568019..55afd919 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -7,7 +7,7 @@ gradle-wrapper.jar GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 6b8eb878..b189d473 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -5,43 +5,29 @@ plugins { id "dev.flutter.flutter-gradle-plugin" } -def localProperties = new Properties() -def localPropertiesFile = rootProject.file("local.properties") -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader("UTF-8") { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty("flutter.versionCode") -if (flutterVersionCode == null) { - flutterVersionCode = "1" -} - -def flutterVersionName = localProperties.getProperty("flutter.versionName") -if (flutterVersionName == null) { - flutterVersionName = "1.0" -} - android { namespace = "com.zebra.zeta.example" compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion + ndkVersion = "25.1.8937393" compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.zebra.zeta.example" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion - versionCode = flutterVersionCode.toInteger() - versionName = flutterVersionName + versionCode = flutter.versionCode + versionName = flutter.versionName } buildTypes { diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 3b5b324f..25971708 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -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 e1ca574e..9c5194d3 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-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip \ No newline at end of file diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 536165d3..a00f9ea7 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -18,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false + id "com.android.application" version "8.3.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false } include ":app" diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 15073017..47f4958e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -6,7 +6,7 @@ PODS: - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS - - sqflite (0.0.3): + - sqflite_darwin (0.0.4): - Flutter - FlutterMacOS - url_launcher_ios (0.0.1): @@ -16,7 +16,7 @@ DEPENDENCIES: - Flutter (from `Flutter`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - - sqflite (from `.symlinks/plugins/sqflite/darwin`) + - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) EXTERNAL SOURCES: @@ -26,8 +26,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/path_provider_foundation/darwin" shared_preferences_foundation: :path: ".symlinks/plugins/shared_preferences_foundation/darwin" - sqflite: - :path: ".symlinks/plugins/sqflite/darwin" + sqflite_darwin: + :path: ".symlinks/plugins/sqflite_darwin/darwin" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" @@ -35,7 +35,7 @@ SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 - sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec + sqflite_darwin: a553b1fd6fe66f53bbb0fe5b4f5bab93f08d7a13 url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011 diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift index 70693e4a..b6363034 100644 --- a/example/ios/Runner/AppDelegate.swift +++ b/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/lib/src/components/navigation bar/navigation_bar.dart b/lib/src/components/navigation bar/navigation_bar.dart index 06dfe081..5d530614 100644 --- a/lib/src/components/navigation bar/navigation_bar.dart +++ b/lib/src/components/navigation bar/navigation_bar.dart @@ -43,6 +43,7 @@ class ZetaNavigationBar extends ZetaStatelessWidget { this.action, this.semanticLabel, this.shrinkItems = false, + this.useSafeArea = true, }) : assert( items.length >= 2 && items.length <= 6, 'The number of items should be between 2 and 6', @@ -58,6 +59,7 @@ class ZetaNavigationBar extends ZetaStatelessWidget { this.dividerIndex, this.semanticLabel, this.shrinkItems = false, + this.useSafeArea = true, }) : splitItems = false, action = null; @@ -71,6 +73,7 @@ class ZetaNavigationBar extends ZetaStatelessWidget { this.onTap, this.dividerIndex, this.semanticLabel, + this.useSafeArea = true, }) : splitItems = true, action = null, shrinkItems = true; @@ -85,6 +88,7 @@ class ZetaNavigationBar extends ZetaStatelessWidget { this.onTap, this.semanticLabel, this.shrinkItems = false, + this.useSafeArea = true, }) : dividerIndex = null, splitItems = false; @@ -117,6 +121,9 @@ class ZetaNavigationBar extends ZetaStatelessWidget { /// When set to false the items will take up equal space and will expand to fill the bar. final bool shrinkItems; + /// Whether the child should be wrapped in a [SafeArea]. + final bool useSafeArea; + Row _generateNavigationItemRow(List items, BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -184,11 +191,7 @@ class ZetaNavigationBar extends ZetaStatelessWidget { color: colors.surfacePrimary, border: Border(top: BorderSide(color: colors.borderSubtle)), ), - child: Semantics( - child: SafeArea( - child: child, - ), - ), + child: Semantics(child: useSafeArea ? SafeArea(child: child) : child), ); } @@ -202,7 +205,8 @@ class ZetaNavigationBar extends ZetaStatelessWidget { ..add(DiagnosticsProperty('splitItems', splitItems)) ..add(IntProperty('dividerIndex', dividerIndex)) ..add(StringProperty('semanticLabel', semanticLabel)) - ..add(DiagnosticsProperty('shrinkItems', shrinkItems)); + ..add(DiagnosticsProperty('shrinkItems', shrinkItems)) + ..add(DiagnosticsProperty('useSafeArea', useSafeArea)); } }