Skip to content

Commit 5ad7f26

Browse files
committed
Migrated android example to AndroidX
1 parent df1cb99 commit 5ad7f26

File tree

7 files changed

+42
-27
lines changed

7 files changed

+42
-27
lines changed

example/.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_keyboard_visibility","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"multi_image_picker","dependencies":[]},{"name":"permission_handler","dependencies":[]}]}
1+
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_keyboard_visibility","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"permission_handler","dependencies":[]}]}

example/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ android {
4343
targetSdkVersion 28
4444
versionCode flutterVersionCode.toInteger()
4545
versionName flutterVersionName
46-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
46+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4747
}
4848

4949
buildTypes {
@@ -62,6 +62,6 @@ flutter {
6262
dependencies {
6363
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
6464
testImplementation 'junit:junit:4.12'
65-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
66-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
65+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
66+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
6767
}

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.71'
2+
ext.kotlin_version = '1.3.10'
33
repositories {
44
google()
55
jcenter()
66
}
77

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

example/android/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
org.gradle.jvmargs=-Xmx1536M
22

3+
android.enableR8=true
4+
android.useAndroidX=true
5+
android.enableJetifier=true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
1+
#Wed Mar 25 16:41:24 EAT 2020
22
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.4-all.zip

example/lib/main.dart

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,38 @@ class _MyHomePageState extends State<MyHomePage> {
3333
),
3434
body: Padding(
3535
padding: EdgeInsets.all(10),
36-
child: FormBuilder(
37-
key: _formKey,
38-
child: Column(
39-
children: <Widget>[
40-
FormBuilderFilePicker(
41-
attribute: "images",
42-
decoration: InputDecoration(labelText: "Attachments"),
43-
maxImages: 5,
44-
),
45-
],
36+
child: FormBuilder(
37+
key: _formKey,
38+
child: Column(
39+
children: <Widget>[
40+
FormBuilderFilePicker(
41+
attribute: "images",
42+
decoration: InputDecoration(labelText: "Attachments"),
43+
maxFiles: 5,
44+
multiple: true,
45+
previewImages: false,
46+
onChanged: (val) => print(val),
47+
// fileExtension: "PDF",
48+
// fileType: FileType.custom,
49+
selector: Row(
50+
children: <Widget>[
51+
Icon(Icons.file_upload),
52+
Text('Upload'),
53+
],
54+
),
55+
),
56+
SizedBox(height: 20),
57+
RaisedButton(
58+
child: Text('Submit'),
59+
onPressed: () {
60+
_formKey.currentState.save();
61+
print(_formKey.currentState.value);
62+
},
63+
),
64+
],
65+
),
4666
),
4767
),
48-
),
4968
);
5069
}
5170
}

example/pubspec.lock

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ packages:
143143
path: ".."
144144
relative: true
145145
source: path
146-
version: "0.0.1"
146+
version: "0.0.2"
147147
image:
148148
dependency: transitive
149149
description:
@@ -172,13 +172,6 @@ packages:
172172
url: "https://pub.dartlang.org"
173173
source: hosted
174174
version: "1.1.8"
175-
multi_image_picker:
176-
dependency: transitive
177-
description:
178-
name: multi_image_picker
179-
url: "https://pub.dartlang.org"
180-
source: hosted
181-
version: "4.6.4"
182175
path:
183176
dependency: transitive
184177
description:

0 commit comments

Comments
 (0)