Skip to content

Commit 9ffc14d

Browse files
authored
flutter create (#23)
1 parent 704d3bb commit 9ffc14d

37 files changed

+1209
-54
lines changed

android/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ gradle-wrapper.jar
55
/gradlew.bat
66
/local.properties
77
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
12+
**/*.keystore
13+
**/*.jks

android/app/build.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,26 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 30
29+
compileSdkVersion flutter.compileSdkVersion
3030

31-
sourceSets {
32-
main.java.srcDirs += 'src/main/kotlin'
31+
compileOptions {
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
34+
}
35+
36+
kotlinOptions {
37+
jvmTarget = '1.8'
3338
}
3439

35-
lintOptions {
36-
disable 'InvalidPackage'
40+
sourceSets {
41+
main.java.srcDirs += 'src/main/kotlin'
3742
}
3843

3944
defaultConfig {
4045
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4146
applicationId "com.hoc.node_auth"
42-
minSdkVersion 21
43-
targetSdkVersion 30
47+
minSdkVersion flutter.minSdkVersion
48+
targetSdkVersion flutter.targetSdkVersion
4449
versionCode flutterVersionCode.toInteger()
4550
versionName flutterVersionName
4651
}
Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,28 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.hoc.node_auth">
3-
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
4-
calls FlutterMain.startInitialization(this); in its onCreate method.
5-
In most cases you can leave this as-is, but you if you want to provide
6-
additional functionality it is fine to subclass or reimplement
7-
FlutterApplication and put your custom class here. -->
2+
package="com.hoc.node_auth">
3+
84
<uses-permission android:name="android.permission.INTERNET"/>
95

106
<application
11-
android:name="io.flutter.app.FlutterApplication"
12-
android:label="node_auth"
13-
android:requestLegacyExternalStorage="true"
14-
android:icon="@mipmap/ic_launcher">
7+
android:label="node_auth"
8+
android:name="${applicationName}"
9+
android:icon="@mipmap/ic_launcher">
1510
<activity
16-
android:name=".MainActivity"
17-
android:launchMode="singleTop"
18-
android:theme="@style/LaunchTheme"
19-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
20-
android:hardwareAccelerated="true"
21-
android:windowSoftInputMode="adjustResize">
11+
android:name=".MainActivity"
12+
android:exported="true"
13+
android:launchMode="singleTop"
14+
android:theme="@style/LaunchTheme"
15+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
16+
android:hardwareAccelerated="true"
17+
android:windowSoftInputMode="adjustResize">
2218
<!-- Specifies an Android theme to apply to this Activity as soon as
2319
the Android process has started. This theme is visible to the user
2420
while the Flutter UI initializes. After that, this theme continues
2521
to determine the Window background behind the Flutter UI. -->
2622
<meta-data
27-
android:name="io.flutter.embedding.android.NormalTheme"
28-
android:resource="@style/NormalTheme"
29-
/>
30-
<!-- Displays an Android View that continues showing the launch screen
31-
Drawable until Flutter paints its first frame, then this splash
32-
screen fades out. A splash screen is useful to avoid any visual
33-
gap between the end of Android's launch screen and the painting of
34-
Flutter's first frame. -->
35-
<meta-data
36-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
37-
android:resource="@drawable/launch_background"
38-
/>
23+
android:name="io.flutter.embedding.android.NormalTheme"
24+
android:resource="@style/NormalTheme"
25+
/>
3926
<intent-filter>
4027
<action android:name="android.intent.action.MAIN"/>
4128
<category android:name="android.intent.category.LAUNCHER"/>
@@ -44,7 +31,7 @@
4431
<!-- Don't delete the meta-data below.
4532
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
4633
<meta-data
47-
android:name="flutterEmbedding"
48-
android:value="2" />
34+
android:name="flutterEmbedding"
35+
android:value="2"/>
4936
</application>
5037
</manifest>

android/app/src/main/kotlin/com/hoc/node_auth/MainActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ package com.hoc.node_auth
22

33
import io.flutter.embedding.android.FlutterActivity
44

5-
class MainActivity: FlutterActivity()
5+
class MainActivity: FlutterActivity() {
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Lines changed: 18 additions & 0 deletions
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+
Flutter 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>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
66
Flutter draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
@@ -10,9 +10,9 @@
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>

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
buildscript {
2-
ext.kotlin_version = '1.5.31'
2+
ext.kotlin_version = '1.6.10'
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.2.2'
9+
classpath 'com.android.tools.build:gradle:4.1.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
1313

1414
allprojects {
1515
repositories {
1616
google()
17-
jcenter()
17+
mavenCentral()
1818
}
1919
}
2020

android/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
org.gradle.jvmargs=-Xmx1536M
2-
android.enableR8=true
32
android.useAndroidX=true
43
android.enableJetifier=true

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
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-6.9.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

0 commit comments

Comments
 (0)