Skip to content

Commit 3c01adc

Browse files
committed
Update sample
1 parent eae5441 commit 3c01adc

File tree

28 files changed

+173
-344
lines changed

28 files changed

+173
-344
lines changed

flutter_cache_manager/example/.metadata

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,39 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 6a3ff018b199a7febbe2b5adbb564081d8f49e2f
8-
channel: dev
7+
revision: "b0850beeb25f6d5b10426284f506557f66181b36"
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: b0850beeb25f6d5b10426284f506557f66181b36
17+
base_revision: b0850beeb25f6d5b10426284f506557f66181b36
18+
- platform: android
19+
create_revision: b0850beeb25f6d5b10426284f506557f66181b36
20+
base_revision: b0850beeb25f6d5b10426284f506557f66181b36
21+
- platform: ios
22+
create_revision: b0850beeb25f6d5b10426284f506557f66181b36
23+
base_revision: b0850beeb25f6d5b10426284f506557f66181b36
24+
- platform: macos
25+
create_revision: b0850beeb25f6d5b10426284f506557f66181b36
26+
base_revision: b0850beeb25f6d5b10426284f506557f66181b36
27+
- platform: web
28+
create_revision: b0850beeb25f6d5b10426284f506557f66181b36
29+
base_revision: b0850beeb25f6d5b10426284f506557f66181b36
30+
- platform: windows
31+
create_revision: b0850beeb25f6d5b10426284f506557f66181b36
32+
base_revision: b0850beeb25f6d5b10426284f506557f66181b36
33+
34+
# User provided section
35+
36+
# List of Local paths (relative to this file) that should be
37+
# ignored by the migrate tool.
38+
#
39+
# Files that are not part of the templates will be ignored by default.
40+
unmanaged_files:
41+
- 'lib/main.dart'
42+
- 'ios/Runner.xcodeproj/project.pbxproj'
Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,58 @@
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"
6+
}
7+
18
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
9+
def localPropertiesFile = rootProject.file("local.properties")
310
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localPropertiesFile.withReader("UTF-8") { reader ->
512
localProperties.load(reader)
613
}
714
}
815

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')
16+
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
1517
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
18+
flutterVersionCode = "1"
1719
}
1820

19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
def flutterVersionName = localProperties.getProperty("flutter.versionName")
2022
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
23+
flutterVersionName = "1.0"
2224
}
2325

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2826
android {
29-
namespace "com.baseflow.example"
30-
compileSdkVersion 33
31-
ndkVersion flutter.ndkVersion
27+
namespace = "com.example.example"
28+
compileSdk = flutter.compileSdkVersion
29+
ndkVersion = flutter.ndkVersion
3230

3331
compileOptions {
34-
sourceCompatibility JavaVersion.VERSION_1_8
35-
targetCompatibility JavaVersion.VERSION_1_8
36-
}
37-
38-
kotlinOptions {
39-
jvmTarget = '1.8'
40-
}
41-
42-
sourceSets {
43-
main.java.srcDirs += 'src/main/kotlin'
32+
sourceCompatibility = JavaVersion.VERSION_1_8
33+
targetCompatibility = JavaVersion.VERSION_1_8
4434
}
4535

4636
defaultConfig {
47-
applicationId "com.baseflow.example"
48-
minSdkVersion 21
49-
targetSdkVersion 33
50-
versionCode flutterVersionCode.toInteger()
51-
versionName flutterVersionName
37+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
38+
applicationId = "com.example.example"
39+
// You can update the following values to match your application needs.
40+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
41+
minSdk = flutter.minSdkVersion
42+
targetSdk = flutter.targetSdkVersion
43+
versionCode = flutterVersionCode.toInteger()
44+
versionName = flutterVersionName
5245
}
5346

5447
buildTypes {
5548
release {
5649
// TODO: Add your own signing config for the release build.
5750
// Signing with the debug keys for now, so `flutter run --release` works.
58-
signingConfig signingConfigs.debug
51+
signingConfig = signingConfigs.debug
5952
}
6053
}
6154
}
6255

6356
flutter {
64-
source '../..'
65-
}
66-
67-
dependencies {
68-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
57+
source = "../.."
6958
}

flutter_cache_manager/example/android/app/src/main/AndroidManifest.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
android:name=".MainActivity"
88
android:exported="true"
99
android:launchMode="singleTop"
10+
android:taskAffinity=""
1011
android:theme="@style/LaunchTheme"
1112
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1213
android:hardwareAccelerated="true"
@@ -30,4 +31,15 @@
3031
android:name="flutterEmbedding"
3132
android:value="2" />
3233
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
3345
</manifest>

flutter_cache_manager/example/android/app/src/main/kotlin/com/baseflow/example/MainActivity.kt

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.example.example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity()

flutter_cache_manager/example/android/build.gradle

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.4.2'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
174
mavenCentral()
185
}
196
}
207

21-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
229
subprojects {
2310
project.buildDir = "${rootProject.buildDir}/${project.name}"
2411
}
2512
subprojects {
26-
project.evaluationDependsOn(':app')
13+
project.evaluationDependsOn(":app")
2714
}
2815

2916
tasks.register("clean", Delete) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true

flutter_cache_manager/example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
Lines changed: 22 additions & 8 deletions
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 "7.3.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
23+
}
24+
25+
include ":app"

flutter_cache_manager/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

0 commit comments

Comments
 (0)