Skip to content

Commit b8e3dce

Browse files
committed
chore: updated android example
1 parent 520a7b6 commit b8e3dce

File tree

12 files changed

+100
-68
lines changed

12 files changed

+100
-68
lines changed

example/.metadata

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

66
version:
7-
revision: 67826bdce54505760fe83b7ead70bdb5af6fe9f2
8-
channel: dev
7+
revision: "ead455963c12b453cdb2358cad34969c76daf180"
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: ead455963c12b453cdb2358cad34969c76daf180
17+
base_revision: ead455963c12b453cdb2358cad34969c76daf180
18+
- platform: android
19+
create_revision: ead455963c12b453cdb2358cad34969c76daf180
20+
base_revision: ead455963c12b453cdb2358cad34969c76daf180
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/android/app/build.gradle

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

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-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,12 +22,10 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
29-
compileSdkVersion 31
26+
namespace "com.example.example"
27+
compileSdkVersion flutter.compileSdkVersion
28+
ndkVersion flutter.ndkVersion
3029

3130
compileOptions {
3231
sourceCompatibility JavaVersion.VERSION_1_8
@@ -43,9 +42,11 @@ android {
4342

4443
defaultConfig {
4544
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46-
applicationId "dev.jerson.fast_rsa_example"
47-
minSdkVersion 19
48-
targetSdkVersion 31
45+
applicationId "com.example.example"
46+
// You can update the following values to match your application needs.
47+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48+
minSdkVersion flutter.minSdkVersion
49+
targetSdkVersion flutter.targetSdkVersion
4950
versionCode flutterVersionCode.toInteger()
5051
versionName flutterVersionName
5152
}
@@ -63,6 +64,4 @@ flutter {
6364
source '../..'
6465
}
6566

66-
dependencies {
67-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68-
}
67+
dependencies {}

example/android/app/src/debug/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="dev.jerson.fast_rsa_example">
3-
<!-- Flutter needs it to communicate with the running application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.INTERNET"/>

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="dev.jerson.fast_rsa_example">
3-
<application
4-
android:label="fast_rsa_example"
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
3+
android:label="example"
4+
android:name="${applicationName}"
55
android:icon="@mipmap/ic_launcher">
66
<activity
77
android:name=".MainActivity"
8+
android:exported="true"
89
android:launchMode="singleTop"
910
android:theme="@style/LaunchTheme"
1011
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

example/android/app/src/main/kotlin/dev/jerson/fast_rsa_example/MainActivity.kt

-6
This file was deleted.

example/android/app/src/main/res/values-night/styles.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
44
<style name="LaunchTheme" parent="@android:style/Theme.Black.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. -->
1515
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
1616
<item name="android:windowBackground">?android:colorBackground</item>

example/android/app/src/main/res/values/styles.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
44
<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. -->
1515
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
1616
<item name="android:windowBackground">?android:colorBackground</item>

example/android/app/src/profile/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="dev.jerson.fast_rsa_example">
3-
<!-- Flutter needs it to communicate with the running application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.INTERNET"/>

example/android/build.gradle

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.6.10'
2+
ext.kotlin_version = '1.7.10'
33
repositories {
44
google()
55
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.0'
9+
classpath 'com.android.tools.build:gradle:7.3.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
@@ -21,9 +21,11 @@ allprojects {
2121
rootProject.buildDir = '../build'
2222
subprojects {
2323
project.buildDir = "${rootProject.buildDir}/${project.name}"
24+
}
25+
subprojects {
2426
project.evaluationDependsOn(':app')
2527
}
2628

27-
task clean(type: Delete) {
29+
tasks.register("clean", Delete) {
2830
delete rootProject.buildDir
2931
}
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.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

example/android/settings.gradle

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
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+
}
9+
settings.ext.flutterSdkPath = flutterSdkPath()
210

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
11+
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
512

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
13+
plugins {
14+
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
15+
}
16+
}
817

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"
18+
include ":app"
19+
20+
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"

example/pubspec.lock

+25-17
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ packages:
6161
dependency: transitive
6262
description:
6363
name: collection
64-
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
64+
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
6565
url: "https://pub.dev"
6666
source: hosted
67-
version: "1.17.1"
67+
version: "1.17.2"
6868
convert:
6969
dependency: transitive
7070
description:
@@ -226,18 +226,18 @@ packages:
226226
dependency: transitive
227227
description:
228228
name: matcher
229-
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
229+
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
230230
url: "https://pub.dev"
231231
source: hosted
232-
version: "0.12.15"
232+
version: "0.12.16"
233233
material_color_utilities:
234234
dependency: transitive
235235
description:
236236
name: material_color_utilities
237-
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
237+
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
238238
url: "https://pub.dev"
239239
source: hosted
240-
version: "0.2.0"
240+
version: "0.5.0"
241241
meta:
242242
dependency: transitive
243243
description:
@@ -367,10 +367,10 @@ packages:
367367
dependency: transitive
368368
description:
369369
name: source_span
370-
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
370+
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
371371
url: "https://pub.dev"
372372
source: hosted
373-
version: "1.9.1"
373+
version: "1.10.0"
374374
stack_trace:
375375
dependency: transitive
376376
description:
@@ -415,26 +415,26 @@ packages:
415415
dependency: "direct dev"
416416
description:
417417
name: test
418-
sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4"
418+
sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46"
419419
url: "https://pub.dev"
420420
source: hosted
421-
version: "1.24.1"
421+
version: "1.24.3"
422422
test_api:
423423
dependency: transitive
424424
description:
425425
name: test_api
426-
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
426+
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
427427
url: "https://pub.dev"
428428
source: hosted
429-
version: "0.5.1"
429+
version: "0.6.0"
430430
test_core:
431431
dependency: transitive
432432
description:
433433
name: test_core
434-
sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93"
434+
sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e"
435435
url: "https://pub.dev"
436436
source: hosted
437-
version: "0.5.1"
437+
version: "0.5.3"
438438
typed_data:
439439
dependency: transitive
440440
description:
@@ -455,10 +455,10 @@ packages:
455455
dependency: transitive
456456
description:
457457
name: vm_service
458-
sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe
458+
sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f
459459
url: "https://pub.dev"
460460
source: hosted
461-
version: "11.3.0"
461+
version: "11.7.1"
462462
watcher:
463463
dependency: transitive
464464
description:
@@ -467,6 +467,14 @@ packages:
467467
url: "https://pub.dev"
468468
source: hosted
469469
version: "1.0.2"
470+
web:
471+
dependency: transitive
472+
description:
473+
name: web
474+
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
475+
url: "https://pub.dev"
476+
source: hosted
477+
version: "0.1.4-beta"
470478
web_socket_channel:
471479
dependency: transitive
472480
description:
@@ -500,5 +508,5 @@ packages:
500508
source: hosted
501509
version: "3.1.1"
502510
sdks:
503-
dart: ">=3.0.0-0 <4.0.0"
511+
dart: ">=3.1.0-185.0.dev <4.0.0"
504512
flutter: ">=1.10.0"

0 commit comments

Comments
 (0)