Skip to content

Commit 202dfe7

Browse files
committed
Updates to latest Flutter project settings
1 parent 878a6ce commit 202dfe7

File tree

28 files changed

+189
-129
lines changed

28 files changed

+189
-129
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
jobs:
44
"android":
55
docker:
6-
- image: mobiledevops/flutter-sdk-image:v1.9.1-hotfix.2
6+
- image: mobiledevops/flutter-sdk-image:1.22.5
77
steps:
88
- checkout
99
- run:
@@ -20,7 +20,7 @@ jobs:
2020
command: npm install -g fvm
2121
- run:
2222
name: Install Flutter SDK
23-
command: fvm stable && fvm v1.9.1+hotfix.2
23+
command: fvm stable && fvm 1.22.5
2424
- run:
2525
name: Compile iOS App
2626
command: flutter build ios --release --no-codesign

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: mobiledevops/flutter-sdk-image:v1.9.1-hotfix.2
1+
image: mobiledevops/flutter-sdk-image:1.22.5
22

33
stages:
44
- build

.travis.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
env:
33
global:
4-
- FLUTTER_VERSION=v1.9.1+hotfix.2
5-
- DOCKER_IMAGE=mobiledevops/flutter-sdk-image:v1.9.1-hotfix.2
4+
- FLUTTER_VERSION=1.22.5
5+
- DOCKER_IMAGE=mobiledevops/flutter-sdk-image:1.22.5
66

77
matrix:
88
include:
@@ -11,7 +11,7 @@ matrix:
1111
services:
1212
- docker
1313
- os: osx
14-
osx_image: xcode10.3
14+
osx_image: xcode12.3
1515

1616
before_install:
1717
- |
@@ -24,8 +24,6 @@ before_install:
2424
2525
- |
2626
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
27-
bundle install
28-
2927
npm install -g fvm
3028
fvm stable > /dev/null
3129
fvm $FLUTTER_VERSION > /dev/null

android/.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties

android/app/build.gradle

+9-7
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,27 @@ if (flutterVersionName == null) {
2222
}
2323

2424
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
2526
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2627

2728
android {
28-
compileSdkVersion 28
29+
compileSdkVersion 29
30+
31+
sourceSets {
32+
main.java.srcDirs += 'src/main/kotlin'
33+
}
2934

3035
lintOptions {
3136
disable 'InvalidPackage'
3237
}
3338

3439
defaultConfig {
3540
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36-
applicationId "net.mobiledevops.fluttercidemo"
41+
applicationId "com.example.flutter_demo"
3742
minSdkVersion 16
38-
targetSdkVersion 28
43+
targetSdkVersion 29
3944
versionCode flutterVersionCode.toInteger()
4045
versionName flutterVersionName
41-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
4246
}
4347

4448
buildTypes {
@@ -55,7 +59,5 @@ flutter {
5559
}
5660

5761
dependencies {
58-
testImplementation 'junit:junit:4.12'
59-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
60-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
62+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
6163
}

android/app/src/debug/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="net.mobiledevops.fluttercidemo">
2+
package="com.example.flutter_demo">
33
<!-- Flutter needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
+24-10
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,47 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="net.mobiledevops.fluttercidemo">
3-
2+
package="com.example.flutter_demo">
43
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
54
calls FlutterMain.startInitialization(this); in its onCreate method.
65
In most cases you can leave this as-is, but you if you want to provide
76
additional functionality it is fine to subclass or reimplement
87
FlutterApplication and put your custom class here. -->
98
<application
109
android:name="io.flutter.app.FlutterApplication"
11-
android:label="fluttercidemo"
10+
android:label="flutter_demo"
1211
android:icon="@mipmap/ic_launcher">
1312
<activity
1413
android:name=".MainActivity"
1514
android:launchMode="singleTop"
1615
android:theme="@style/LaunchTheme"
17-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
16+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1817
android:hardwareAccelerated="true"
1918
android:windowSoftInputMode="adjustResize">
20-
<!-- This keeps the window background of the activity showing
21-
until Flutter renders its first frame. It can be removed if
22-
there is no splash screen (such as the default splash screen
23-
defined in @style/LaunchTheme). -->
19+
<!-- Specifies an Android theme to apply to this Activity as soon as
20+
the Android process has started. This theme is visible to the user
21+
while the Flutter UI initializes. After that, this theme continues
22+
to determine the Window background behind the Flutter UI. -->
2423
<meta-data
25-
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
26-
android:value="true" />
24+
android:name="io.flutter.embedding.android.NormalTheme"
25+
android:resource="@style/NormalTheme"
26+
/>
27+
<!-- Displays an Android View that continues showing the launch screen
28+
Drawable until Flutter paints its first frame, then this splash
29+
screen fades out. A splash screen is useful to avoid any visual
30+
gap between the end of Android's launch screen and the painting of
31+
Flutter's first frame. -->
32+
<meta-data
33+
android:name="io.flutter.embedding.android.SplashScreenDrawable"
34+
android:resource="@drawable/launch_background"
35+
/>
2736
<intent-filter>
2837
<action android:name="android.intent.action.MAIN"/>
2938
<category android:name="android.intent.category.LAUNCHER"/>
3039
</intent-filter>
3140
</activity>
41+
<!-- Don't delete the meta-data below.
42+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
43+
<meta-data
44+
android:name="flutterEmbedding"
45+
android:value="2" />
3246
</application>
3347
</manifest>

android/app/src/main/java/net/mobiledevops/fluttercidemo/MainActivity.java

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.example.flutter_demo
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity() {
6+
}
+10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting -->
34
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
45
<!-- Show a splash screen on the activity. Automatically removed when
56
Flutter draws its first frame -->
67
<item name="android:windowBackground">@drawable/launch_background</item>
78
</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:color/white</item>
17+
</style>
818
</resources>

android/app/src/profile/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="net.mobiledevops.fluttercidemo">
2+
package="com.example.flutter_demo">
33
<!-- Flutter needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->

android/build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
buildscript {
2+
ext.kotlin_version = '1.3.50'
23
repositories {
34
google()
45
jcenter()
56
}
67

78
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.2.1'
9+
classpath 'com.android.tools.build:gradle:3.5.0'
10+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
911
}
1012
}
1113

android/gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
org.gradle.jvmargs=-Xmx1536M
2-
2+
android.useAndroidX=true
3+
android.enableJetifier=true

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

android/settings.gradle

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
include ':app'
22

3-
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
3+
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4+
def properties = new Properties()
45

5-
def plugins = new Properties()
6-
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7-
if (pluginsFile.exists()) {
8-
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9-
}
6+
assert localPropertiesFile.exists()
7+
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
108

11-
plugins.each { name, path ->
12-
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13-
include ":$name"
14-
project(":$name").projectDir = pluginDirectory
15-
}
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"

ios/.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*.mode1v3
2+
*.mode2v3
3+
*.moved-aside
4+
*.pbxuser
5+
*.perspectivev3
6+
**/*sync/
7+
.sconsign.dblite
8+
.tags*
9+
**/.vagrant/
10+
**/DerivedData/
11+
Icon?
12+
**/Pods/
13+
**/.symlinks/
14+
profile
15+
xcuserdata
16+
**/.generated/
17+
Flutter/App.framework
18+
Flutter/Flutter.framework
19+
Flutter/Flutter.podspec
20+
Flutter/Generated.xcconfig
21+
Flutter/app.flx
22+
Flutter/app.zip
23+
Flutter/flutter_assets/
24+
Flutter/flutter_export_environment.sh
25+
ServiceDefinitions.json
26+
Runner/GeneratedPluginRegistrant.*
27+
28+
# Exceptions to above rules.
29+
!default.mode1v3
30+
!default.mode2v3
31+
!default.pbxuser
32+
!default.perspectivev3

0 commit comments

Comments
 (0)