diff --git a/example/.metadata b/example/.metadata
index 90afe1c3..a072c7d9 100644
--- a/example/.metadata
+++ b/example/.metadata
@@ -1,11 +1,11 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
-# This file should be version controlled.
+# This file should be version controlled and should not be manually edited.
version:
- revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
- channel: stable
+ revision: "d211f42860350d914a5ad8102f9ec32764dc6d06"
+ channel: "stable"
project_type: app
@@ -13,11 +13,11 @@ project_type: app
migration:
platforms:
- platform: root
- create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
- base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
- - platform: linux
- create_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
- base_revision: d3d8effc686d73e0114d71abdcccef63fa1f25d2
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ - platform: android
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
# User provided section
diff --git a/example/android/.gitignore b/example/android/.gitignore
new file mode 100644
index 00000000..6f568019
--- /dev/null
+++ b/example/android/.gitignore
@@ -0,0 +1,13 @@
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
+/local.properties
+GeneratedPluginRegistrant.java
+
+# Remember to never publicly share your keystore.
+# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+key.properties
+**/*.keystore
+**/*.jks
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
new file mode 100644
index 00000000..118ee1d9
--- /dev/null
+++ b/example/android/app/build.gradle
@@ -0,0 +1,67 @@
+plugins {
+ id "com.android.application"
+ id "kotlin-android"
+ 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.example.example"
+ compileSdkVersion flutter.compileSdkVersion
+ ndkVersion flutter.ndkVersion
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+
+ sourceSets {
+ main.java.srcDirs += 'src/main/kotlin'
+ }
+
+ defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
+ applicationId "com.example.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.
+ minSdkVersion flutter.minSdkVersion
+ targetSdkVersion flutter.targetSdkVersion
+ versionCode flutterVersionCode.toInteger()
+ versionName flutterVersionName
+ }
+
+ 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.debug
+ }
+ }
+}
+
+flutter {
+ source '../..'
+}
+
+dependencies {}
diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml
new file mode 100644
index 00000000..399f6981
--- /dev/null
+++ b/example/android/app/src/debug/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..19b862ec
--- /dev/null
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt
new file mode 100644
index 00000000..e793a000
--- /dev/null
+++ b/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt
@@ -0,0 +1,6 @@
+package com.example.example
+
+import io.flutter.embedding.android.FlutterActivity
+
+class MainActivity: FlutterActivity() {
+}
diff --git a/example/android/app/src/main/res/drawable-v21/launch_background.xml b/example/android/app/src/main/res/drawable-v21/launch_background.xml
new file mode 100644
index 00000000..f74085f3
--- /dev/null
+++ b/example/android/app/src/main/res/drawable-v21/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/example/android/app/src/main/res/drawable/launch_background.xml b/example/android/app/src/main/res/drawable/launch_background.xml
new file mode 100644
index 00000000..304732f8
--- /dev/null
+++ b/example/android/app/src/main/res/drawable/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..db77bb4b
Binary files /dev/null and b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..17987b79
Binary files /dev/null and b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..09d43914
Binary files /dev/null and b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..d5f1c8d3
Binary files /dev/null and b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..4d6372ee
Binary files /dev/null and b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 00000000..06952be7
--- /dev/null
+++ b/example/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml
new file mode 100644
index 00000000..cb1ef880
--- /dev/null
+++ b/example/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/example/android/app/src/profile/AndroidManifest.xml b/example/android/app/src/profile/AndroidManifest.xml
new file mode 100644
index 00000000..399f6981
--- /dev/null
+++ b/example/android/app/src/profile/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/example/android/build.gradle b/example/android/build.gradle
new file mode 100644
index 00000000..f7eb7f63
--- /dev/null
+++ b/example/android/build.gradle
@@ -0,0 +1,31 @@
+buildscript {
+ ext.kotlin_version = '1.7.10'
+ repositories {
+ google()
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:7.3.0'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+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/gradle.properties b/example/android/gradle.properties
new file mode 100644
index 00000000..94adc3a3
--- /dev/null
+++ b/example/android/gradle.properties
@@ -0,0 +1,3 @@
+org.gradle.jvmargs=-Xmx1536M
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..3c472b99
--- /dev/null
+++ b/example/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
diff --git a/example/android/settings.gradle b/example/android/settings.gradle
new file mode 100644
index 00000000..55c4ca8b
--- /dev/null
+++ b/example/android/settings.gradle
@@ -0,0 +1,20 @@
+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
+ }
+ settings.ext.flutterSdkPath = flutterSdkPath()
+
+ includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
+
+ plugins {
+ id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
+ }
+}
+
+include ":app"
+
+apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
diff --git a/example/lib/src/home/home_page.dart b/example/lib/src/home/home_page.dart
index de6b31aa..cddbf71a 100644
--- a/example/lib/src/home/home_page.dart
+++ b/example/lib/src/home/home_page.dart
@@ -103,9 +103,10 @@ class HomePageState extends State {
onDestinationSelected: (index) =>
setState(() => _selectedIndex = index),
),
- const VerticalDivider(
- width: 0.0,
- ),
+ if (!isMobile)
+ const VerticalDivider(
+ width: 0.0,
+ ),
Expanded(
child: Center(
child: _items.entries.elementAt(_selectedIndex).key,
@@ -121,9 +122,10 @@ class HomePageState extends State {
child: _items.entries.elementAt(_selectedIndex).key,
),
),
- const Divider(
- height: 0.0,
- ),
+ if (!isMobile)
+ const Divider(
+ height: 0.0,
+ ),
NavigationBar(
destinations: [
for (final item in _items.entries)
diff --git a/lib/src/themes/common_themes.dart b/lib/src/themes/common_themes.dart
index bca14104..a582cf97 100644
--- a/lib/src/themes/common_themes.dart
+++ b/lib/src/themes/common_themes.dart
@@ -43,10 +43,10 @@ AppBarTheme _createAppBarTheme(ColorScheme colorScheme) {
),
iconTheme: IconThemeData(
color: colorScheme.onSurface,
- size: isMobile ? kComfortableIconSize : kCompactIconSize,
+ size: kCompactIconSize,
),
actionsIconTheme: IconThemeData(color: colorScheme.onSurface),
- toolbarHeight: isMobile ? kComfortableAppBarHeight : kCompactAppBarHeight,
+ toolbarHeight: kCompactAppBarHeight,
);
}
@@ -115,24 +115,19 @@ InputDecorationTheme _createInputDecorationTheme(ColorScheme colorScheme) {
),
borderRadius: radius,
),
- isDense: isMobile ? false : true,
+ isDense: true,
iconColor: colorScheme.onSurface,
- contentPadding: isMobile
- ? const EdgeInsets.all(12)
- : const EdgeInsets.only(left: 12, right: 12, bottom: 9, top: 10),
- helperStyle: isMobile ? null : textStyle,
- hintStyle: isMobile ? null : textStyle,
- labelStyle: isMobile ? null : textStyle,
- suffixStyle: isMobile
- ? null
- : textStyle.copyWith(
- color: colorScheme.onSurface.scale(lightness: -0.2),
- ),
- prefixStyle: isMobile
- ? null
- : textStyle.copyWith(
- color: colorScheme.onSurface.scale(lightness: -0.2),
- ),
+ contentPadding:
+ const EdgeInsets.only(left: 12, right: 12, bottom: 9, top: 10),
+ helperStyle: textStyle,
+ hintStyle: textStyle,
+ labelStyle: textStyle,
+ suffixStyle: textStyle.copyWith(
+ color: colorScheme.onSurface.scale(lightness: -0.2),
+ ),
+ prefixStyle: textStyle.copyWith(
+ color: colorScheme.onSurface.scale(lightness: -0.2),
+ ),
);
}
@@ -149,18 +144,9 @@ const _tooltipThemeData = TooltipThemeData(
// Buttons
-final _commonButtonStyle = ButtonStyle(
- padding: isMobile
- ? const MaterialStatePropertyAll(
- EdgeInsets.symmetric(
- horizontal: 16,
- vertical: 18,
- ),
- )
- : const MaterialStatePropertyAll(EdgeInsets.all(16)),
- iconSize: isMobile
- ? const MaterialStatePropertyAll(kComfortableButtonIconSize)
- : const MaterialStatePropertyAll(kCompactButtonIconSize),
+const _commonButtonStyle = ButtonStyle(
+ padding: MaterialStatePropertyAll(EdgeInsets.all(16)),
+ iconSize: MaterialStatePropertyAll(kCompactButtonIconSize),
);
final _buttonThemeData = ButtonThemeData(
@@ -247,23 +233,15 @@ FilledButtonThemeData _createFilledButtonTheme(
IconButtonThemeData _createIconButtonTheme(ColorScheme colorScheme) {
return IconButtonThemeData(
style: IconButton.styleFrom(
- padding: isMobile ? null : EdgeInsets.zero,
+ padding: EdgeInsets.zero,
foregroundColor: colorScheme.onSurface,
highlightColor: colorScheme.onSurface.withOpacity(0.05),
surfaceTintColor: colorScheme.background,
- fixedSize: isMobile
- ? null
- : const Size(kCompactButtonHeight, kCompactButtonHeight),
- minimumSize: isMobile
- ? null
- : const Size(kCompactButtonHeight, kCompactButtonHeight),
- maximumSize: isMobile
- ? null
- : const Size(kCompactButtonHeight, kCompactButtonHeight),
- tapTargetSize: isMobile
- ? MaterialTapTargetSize.padded
- : MaterialTapTargetSize.shrinkWrap,
- iconSize: isMobile ? kComfortableIconSize : kCompactIconSize,
+ fixedSize: const Size(kCompactButtonHeight, kCompactButtonHeight),
+ minimumSize: const Size(kCompactButtonHeight, kCompactButtonHeight),
+ maximumSize: const Size(kCompactButtonHeight, kCompactButtonHeight),
+ tapTargetSize: MaterialTapTargetSize.shrinkWrap,
+ iconSize: kCompactIconSize,
),
);
}
@@ -277,16 +255,16 @@ MenuButtonThemeData _createMenuItemTheme(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
alignment: Alignment.center,
textStyle: MaterialStatePropertyAll(textTheme.bodyMedium),
- maximumSize: MaterialStatePropertyAll(
+ maximumSize: const MaterialStatePropertyAll(
Size(
999,
- (isMobile ? kComfortableButtonHeight : kCompactButtonHeight) + 10,
+ (kCompactButtonHeight) + 10,
),
),
- minimumSize: MaterialStatePropertyAll(
+ minimumSize: const MaterialStatePropertyAll(
Size(
20,
- (isMobile ? kComfortableButtonHeight : kCompactButtonHeight) + 10,
+ (kCompactButtonHeight) + 10,
),
),
),
@@ -295,19 +273,12 @@ MenuButtonThemeData _createMenuItemTheme(
ToggleButtonsThemeData _createToggleButtonsTheme(ColorScheme colorScheme) {
return ToggleButtonsThemeData(
- constraints: isMobile
- ? const BoxConstraints(
- minHeight: kComfortableButtonHeight,
- minWidth: 60,
- maxWidth: double.infinity,
- maxHeight: kComfortableButtonHeight,
- )
- : const BoxConstraints(
- minHeight: kCompactButtonHeight,
- minWidth: 50,
- maxWidth: double.infinity,
- maxHeight: kCompactButtonHeight,
- ),
+ constraints: const BoxConstraints(
+ minHeight: kCompactButtonHeight,
+ minWidth: 50,
+ maxWidth: double.infinity,
+ maxHeight: kCompactButtonHeight,
+ ),
borderRadius: const BorderRadius.all(Radius.circular(kButtonRadius)),
borderColor: colorScheme.isHighContrast
? colorScheme.outlineVariant
@@ -563,9 +534,9 @@ MenuThemeData _createMenuTheme(ColorScheme colorScheme) {
DropdownMenuThemeData _createDropdownMenuTheme(ColorScheme colorScheme) {
return DropdownMenuThemeData(
inputDecorationTheme: _createInputDecorationTheme(colorScheme).copyWith(
- constraints: BoxConstraints(
- maxHeight: isMobile ? kComfortableButtonHeight : kCompactButtonHeight,
- minHeight: isMobile ? kComfortableButtonHeight : kCompactButtonHeight,
+ constraints: const BoxConstraints(
+ maxHeight: kCompactButtonHeight,
+ minHeight: kCompactButtonHeight,
),
),
menuStyle: _createMenuStyle(colorScheme),
@@ -574,9 +545,7 @@ DropdownMenuThemeData _createDropdownMenuTheme(ColorScheme colorScheme) {
NavigationBarThemeData _createNavigationBarTheme(ColorScheme colorScheme) {
return NavigationBarThemeData(
- height: isMobile
- ? kComfortableNavigationBarHeight
- : kCompactNavigationBarHeight,
+ height: kCompactNavigationBarHeight,
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surface,
indicatorColor: colorScheme.onSurface.withOpacity(0.1),
@@ -594,11 +563,11 @@ NavigationRailThemeData _createNavigationRailTheme(ColorScheme colorScheme) {
indicatorColor: colorScheme.onSurface.withOpacity(0.1),
selectedIconTheme: IconThemeData(
color: colorScheme.onSurface,
- size: isMobile ? kComfortableIconSize : kCompactIconSize,
+ size: kCompactIconSize,
),
unselectedIconTheme: IconThemeData(
color: colorScheme.onSurface.withOpacity(0.8),
- size: isMobile ? kComfortableIconSize : kCompactIconSize,
+ size: kCompactIconSize,
),
);
}
@@ -633,7 +602,7 @@ SnackBarThemeData _createSnackBarTheme(ColorScheme colorScheme) {
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
- isMobile ? kComfortableButtonHeight : kCompactButtonHeight,
+ kCompactButtonHeight,
),
),
);
@@ -660,13 +629,29 @@ ThemeData createYaruTheme({
? colorScheme.outlineVariant
: colorScheme.outline;
final textTheme = createTextTheme(colorScheme.onSurface);
+
+ if (isMobile) {
+ return ThemeData(
+ textTheme: textTheme,
+ dividerColor: dividerColor,
+ scaffoldBackgroundColor: colorScheme.surface,
+ dividerTheme: DividerThemeData(
+ color: dividerColor,
+ space: 1.0,
+ thickness: 1.0,
+ ),
+ useMaterial3: true,
+ colorScheme: colorScheme,
+ );
+ }
+
return ThemeData.from(
useMaterial3: useMaterial3,
colorScheme: colorScheme,
).copyWith(
iconTheme: IconThemeData(
color: colorScheme.onSurface,
- size: isMobile ? kComfortableIconSize : kCompactIconSize,
+ size: kCompactIconSize,
),
primaryIconTheme: IconThemeData(color: colorScheme.onSurface),
progressIndicatorTheme: _createProgressIndicatorTheme(colorScheme),
@@ -727,7 +712,7 @@ ThemeData createYaruTheme({
mainAxisMargin: 3.0,
crossAxisMargin: 3.0,
),
- splashFactory: isMobile ? null : NoSplash.splashFactory,
+ splashFactory: NoSplash.splashFactory,
sliderTheme: _createSliderTheme(colorScheme),
drawerTheme: _createDrawerTheme(colorScheme),
listTileTheme: ListTileThemeData(