Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

兼容到Android sdk 31 #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
apply plugin: 'com.android.library'
group 'com.shinow.qrscan'
version '1.0-SNAPSHOT'

Expand All @@ -21,13 +22,13 @@ rootProject.allprojects {
}
}

apply plugin: 'com.android.library'


android {
compileSdkVersion 28
compileSdkVersion 31

defaultConfig {
minSdkVersion 16
minSdkVersion 23
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
Expand All @@ -50,7 +51,7 @@ if (flutterRoot == null) {
}

dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.picasso:picasso:2.8'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'pub.devrel:easypermissions:3.0.0'
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package android

rootProject.name = 'qrscan'
8 changes: 3 additions & 5 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader)
}
}

Expand All @@ -26,13 +25,12 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.shinow.qrscan_example"
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 23
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
35 changes: 18 additions & 17 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shinow.qrscan_example">
package="com.shinow.qrscan_example">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="QR-Scan"
android:icon="@mipmap/ic_launcher">
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:label="QR-Scan">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:exported="true"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
Expand Down
12 changes: 6 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class _MyAppState extends State<MyApp> {
@override
initState() {
super.initState();
this._inputController = new TextEditingController();
this._outputController = new TextEditingController();
_inputController = TextEditingController();
_outputController = TextEditingController();
}

@override
Expand Down Expand Up @@ -160,12 +160,12 @@ class _MyAppState extends State<MyApp> {
await ImageGallerySaver.saveImage(this.bytes);
SnackBar snackBar;
if (success) {
snackBar = new SnackBar(
snackBar = SnackBar(
content:
new Text('Successful Preservation!'));
Scaffold.of(context).showSnackBar(snackBar);
Text('Successful Preservation!'));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
} else {
snackBar = new SnackBar(
snackBar = SnackBar(
content: new Text('Save failed!'));
}
},
Expand Down
Loading