Skip to content

Commit b16a611

Browse files
authored
1 parent cafec2b commit b16a611

File tree

100 files changed

+3327
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+3327
-236
lines changed

.github/workflows/tests.yml

+6
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ jobs:
9696
run: melos run test:web:firefox
9797
- name: '[Verify step] Test Flutter packages'
9898
run: melos run test:flutter
99+
- uses: actions/setup-java@v4
100+
if: ${{ matrix.sdk == 'stable' }}
101+
with:
102+
distribution: 'adopt'
103+
java-version: '17'
99104
- name: '[Verify step] Build Flutter APK'
105+
if: ${{ matrix.sdk == 'stable' }}
100106
run: melos run build:example:apk
101107
# Coverage
102108
- name: '[Coverage] Format & print test coverage'

example_flutter_app/.metadata

+37-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,42 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 60bd88df915880d23877bfc1602e8ddcf4c4dd2a
8-
channel: beta
7+
revision: "8495dee1fd4aacbe9de707e7581203232f591b2f"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
17+
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
18+
- platform: android
19+
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
20+
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
21+
- platform: ios
22+
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
23+
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
24+
- platform: linux
25+
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
26+
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
27+
- platform: macos
28+
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
29+
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
30+
- platform: web
31+
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
32+
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
33+
- platform: windows
34+
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
35+
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- 'ios/Runner.xcodeproj/project.pbxproj'

example_flutter_app/android/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ gradle-wrapper.jar
77
GeneratedPluginRegistrant.java
88

99
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
10+
# See https://flutter.dev/to/reference-keystore
1111
key.properties
12+
**/*.keystore
13+
**/*.jks
+26-31
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,44 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
176
}
187

19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
22-
}
8+
android {
9+
namespace = "cn.flutter.dio_flutter_example"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
2312

24-
apply plugin: 'com.android.application'
25-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_1_8
15+
targetCompatibility = JavaVersion.VERSION_1_8
16+
}
2617

27-
android {
28-
compileSdkVersion flutter.compileSdkVersion
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_1_8
20+
}
2921

3022
defaultConfig {
31-
applicationId "com.example.flutterApp"
32-
minSdkVersion flutter.minSdkVersion
33-
targetSdkVersion flutter.targetSdkVersion
34-
versionCode flutterVersionCode.toInteger()
35-
versionName flutterVersionName
23+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24+
applicationId = "cn.flutter.dio_flutter_example"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
3631
}
3732

3833
buildTypes {
3934
release {
4035
// TODO: Add your own signing config for the release build.
4136
// Signing with the debug keys for now, so `flutter run --release` works.
42-
signingConfig signingConfigs.debug
37+
signingConfig = signingConfigs.debug
4338
}
4439
}
4540
}
4641

4742
flutter {
48-
source '../..'
43+
source = "../.."
4944
}
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,46 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.flutterApp">
3-
<uses-permission android:name="android.permission.INTERNET" />
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<uses-permission android:name="android.permission.INTERNET"/>
43
<application
5-
android:label="Dio examples"
4+
android:label="dio_flutter_example"
5+
android:name="${applicationName}"
66
android:icon="@mipmap/ic_launcher">
77
<activity
88
android:name=".MainActivity"
9+
android:exported="true"
910
android:launchMode="singleTop"
11+
android:taskAffinity=""
1012
android:theme="@style/LaunchTheme"
1113
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1214
android:hardwareAccelerated="true"
13-
android:windowSoftInputMode="adjustResize"
14-
android:exported="true">
15-
<intent-filter>
16-
<action android:name="android.intent.action.MAIN"/>
17-
<category android:name="android.intent.category.LAUNCHER"/>
18-
</intent-filter>
15+
android:windowSoftInputMode="adjustResize">
1916
<!-- Specifies an Android theme to apply to this Activity as soon as
2017
the Android process has started. This theme is visible to the user
2118
while the Flutter UI initializes. After that, this theme continues
2219
to determine the Window background behind the Flutter UI. -->
2320
<meta-data
24-
android:name="io.flutter.embedding.android.NormalTheme"
25-
android:resource="@style/NormalTheme"
26-
/>
21+
android:name="io.flutter.embedding.android.NormalTheme"
22+
android:resource="@style/NormalTheme"
23+
/>
24+
<intent-filter>
25+
<action android:name="android.intent.action.MAIN"/>
26+
<category android:name="android.intent.category.LAUNCHER"/>
27+
</intent-filter>
2728
</activity>
2829
<!-- Don't delete the meta-data below.
2930
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
3031
<meta-data
3132
android:name="flutterEmbedding"
3233
android:value="2" />
3334
</application>
35+
<!-- Required to query activities that can process text, see:
36+
https://developer.android.com/training/package-visibility and
37+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
38+
39+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
40+
<queries>
41+
<intent>
42+
<action android:name="android.intent.action.PROCESS_TEXT"/>
43+
<data android:mimeType="text/plain"/>
44+
</intent>
45+
</queries>
3446
</manifest>

example_flutter_app/android/app/src/main/java/com/example/flutterApp/MainActivity.java

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package cn.flutter.dio_flutter_example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<!-- Show a splash screen on the activity. Automatically removed when
6+
the Flutter engine draws its first frame -->
7+
<item name="android:windowBackground">@drawable/launch_background</item>
8+
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
18+
</resources>
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<!-- Theme applied to the Android Window while the process is starting -->
4-
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
55
<!-- Show a splash screen on the activity. Automatically removed when
6-
Flutter draws its first frame -->
6+
the Flutter engine draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
88
</style>
99
<!-- Theme applied to the Android Window as soon as the process has started.
1010
This theme determines the color of the Android Window while your
1111
Flutter UI initializes, as well as behind your Flutter UI while its
1212
running.
13-
13+
1414
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15-
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16-
<item name="android:windowBackground">@android:color/white</item>
15+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
1717
</style>
1818
</resources>

example_flutter_app/android/build.gradle

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
buildscript {
2-
repositories {
3-
google()
4-
mavenCentral()
5-
}
6-
7-
dependencies {
8-
classpath 'com.android.tools.build:gradle:7.2.2'
9-
}
10-
}
11-
121
allprojects {
132
repositories {
143
google()
154
mavenCentral()
165
}
176
}
187

19-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
209
subprojects {
2110
project.buildDir = "${rootProject.buildDir}/${project.name}"
2211
}
2312
subprojects {
24-
project.evaluationDependsOn(':app')
13+
project.evaluationDependsOn(":app")
2514
}
2615

2716
tasks.register("clean", Delete) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="android" name="Android">
5+
<configuration>
6+
<option name="ALLOW_USER_CONFIGURATION" value="false" />
7+
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/gen" />
8+
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/gen" />
9+
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/app/src/main/AndroidManifest.xml" />
10+
<option name="RES_FOLDER_RELATIVE_PATH" value="/app/src/main/res" />
11+
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/app/src/main/assets" />
12+
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/app/src/main/libs" />
13+
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/app/src/main/proguard_logs" />
14+
</configuration>
15+
</facet>
16+
</component>
17+
<component name="NewModuleRootManager" inherit-compiler-output="true">
18+
<exclude-output />
19+
<content url="file://$MODULE_DIR$">
20+
<sourceFolder url="file://$MODULE_DIR$/app/src/main/java" isTestSource="false" />
21+
<sourceFolder url="file://$MODULE_DIR$/app/src/main/kotlin" isTestSource="false" />
22+
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
23+
</content>
24+
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
25+
<orderEntry type="sourceFolder" forTests="false" />
26+
<orderEntry type="library" name="Flutter for Android" level="project" />
27+
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
28+
</component>
29+
</module>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
+22-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
23+
}
24+
25+
include ":app"

example_flutter_app/dart_test.yaml

-2
This file was deleted.

example_flutter_app/ios/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
**/dgph
12
*.mode1v3
23
*.mode2v3
34
*.moved-aside
@@ -18,6 +19,7 @@ Flutter/App.framework
1819
Flutter/Flutter.framework
1920
Flutter/Flutter.podspec
2021
Flutter/Generated.xcconfig
22+
Flutter/ephemeral/
2123
Flutter/app.flx
2224
Flutter/app.zip
2325
Flutter/flutter_assets/
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
21
#include "Generated.xcconfig"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
21
#include "Generated.xcconfig"

0 commit comments

Comments
 (0)