mirror of
https://github.com/simplezhli/flutter_barcode_reader.git
synced 2024-11-24 15:39:21 +08:00
Merge pull request #183 from mintware-de/prepare-release
Features: - [Add-to-app support](https://github.com/mintware-de/flutter_barcode_reader/pull/168) - @santiihoyos - Changed overlay to full screen in iOS 13 Bugfixes: - [Fixed rotation on iOS](https://github.com/mintware-de/flutter_barcode_reader/pull/167) - @mintware-de - [#61 Rotating orientation on iPhones only shows half the screen](https://github.com/mintware-de/flutter_barcode_reader/issues/61) Changes: - [Fix compile warning](https://github.com/mintware-de/flutter_barcode_reader/pull/127) - @lookfirst - [Upgrade gradle](https://github.com/mintware-de/flutter_barcode_reader/pull/142) - @SuuSoJeat - `com.android.tools.build:gradle`: 3.3.1 -> 3.5.0 - `org.jetbrains.kotlin:kotlin-gradle-plugin`: 1.3.20 -> 1.3.50 - `compileSdkVersion`: 28 -> 29 - `targetSdkVersion`: 28 -> 29 - `gradle`: 4.10.2 -> 5.4.1 - [Package description updated](https://github.com/mintware-de/flutter_barcode_reader/pull/180) - @connectety - README.md and LICENSE.md updated - Since the project owner has been changed, the package names are different. Checkout the [UPGRADE.md](./UPGRADE.md) for details.
This commit is contained in:
commit
0c5899977e
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ build/
|
|||||||
ios/.generated/
|
ios/.generated/
|
||||||
packages
|
packages
|
||||||
pubspec.lock
|
pubspec.lock
|
||||||
|
example/ios/Podfile.lock
|
||||||
|
26
CHANGELOG.md
26
CHANGELOG.md
@ -2,13 +2,14 @@
|
|||||||
|
|
||||||
Features:
|
Features:
|
||||||
- [Add-to-app support](https://github.com/mintware-de/flutter_barcode_reader/pull/168) - @santiihoyos
|
- [Add-to-app support](https://github.com/mintware-de/flutter_barcode_reader/pull/168) - @santiihoyos
|
||||||
|
- Changed overlay to full screen in iOS 13
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- [Fixed rotation on iOS](https://github.com/mintware-de/flutter_barcode_reader/pull/167) - @mintware-de
|
- [Fixed rotation on iOS](https://github.com/mintware-de/flutter_barcode_reader/pull/167) - @mintware-de
|
||||||
- [#61 Rotating orientation on iPhones only shows half the screen](https://github.com/mintware-de/flutter_barcode_reader/issues/61)
|
- [#61 Rotating orientation on iPhones only shows half the screen](https://github.com/mintware-de/flutter_barcode_reader/issues/61)
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
- [Fix compile warning](https://github.com/apptreesoftware/flutter_barcode_reader/pull/127) - @lookfirst
|
- [Fix compile warning](https://github.com/mintware-de/flutter_barcode_reader/pull/127) - @lookfirst
|
||||||
- [Upgrade gradle](https://github.com/mintware-de/flutter_barcode_reader/pull/142) - @SuuSoJeat
|
- [Upgrade gradle](https://github.com/mintware-de/flutter_barcode_reader/pull/142) - @SuuSoJeat
|
||||||
- `com.android.tools.build:gradle`: 3.3.1 -> 3.5.0
|
- `com.android.tools.build:gradle`: 3.3.1 -> 3.5.0
|
||||||
- `org.jetbrains.kotlin:kotlin-gradle-plugin`: 1.3.20 -> 1.3.50
|
- `org.jetbrains.kotlin:kotlin-gradle-plugin`: 1.3.20 -> 1.3.50
|
||||||
@ -16,40 +17,41 @@ Changes:
|
|||||||
- `targetSdkVersion`: 28 -> 29
|
- `targetSdkVersion`: 28 -> 29
|
||||||
- `gradle`: 4.10.2 -> 5.4.1
|
- `gradle`: 4.10.2 -> 5.4.1
|
||||||
- [Package description updated](https://github.com/mintware-de/flutter_barcode_reader/pull/180) - @connectety
|
- [Package description updated](https://github.com/mintware-de/flutter_barcode_reader/pull/180) - @connectety
|
||||||
|
- README.md and LICENSE.md updated
|
||||||
|
- Since the project owner has been changed, the package names are different. Checkout the [UPGRADE.md](./UPGRADE.md) for details.
|
||||||
|
|
||||||
|
## v1.0.0 - 2018-08-30
|
||||||
## [1.0.0] - 8/30/18
|
|
||||||
|
|
||||||
Breaking Change: Adds support for AndroidX
|
Breaking Change: Adds support for AndroidX
|
||||||
|
|
||||||
## [0.0.8] - 8/30/18
|
## v0.0.8 - 2018-08-30
|
||||||
|
|
||||||
* Fixes [iOS: pressing cancel doesn't stop scanning](https://github.com/apptreesoftware/flutter_barcode_reader/issues/60) thanks to @tgezginis.
|
* Fixes [iOS: pressing cancel doesn't stop scanning](https://github.com/mintware-de/flutter_barcode_reader/issues/60) thanks to @tgezginis.
|
||||||
|
|
||||||
## [0.0.7] - 8/30/18
|
## v0.0.7 - 2018-08-30
|
||||||
|
|
||||||
* Fix iOS barcodes not scanning
|
* Fix iOS barcodes not scanning
|
||||||
|
|
||||||
## [0.0.6] - 8/29/18
|
## v0.0.6 - 2018-08-29
|
||||||
|
|
||||||
* Fix android dependencies
|
* Fix android dependencies
|
||||||
* iOS scanner now looks like Android thanks to @dustin-graham
|
* iOS scanner now looks like Android thanks to @dustin-graham
|
||||||
|
|
||||||
## [0.0.4] - 2/8/18
|
## v0.0.4 - 2018-02-8
|
||||||
|
|
||||||
* Fix missing gradle dependency (thanks to [toteto](https://github.com/apptreesoftware/flutter_barcode_reader/pull/15))
|
* Fix missing gradle dependency (thanks to [toteto](https://github.com/mintware-de/flutter_barcode_reader/pull/15))
|
||||||
* Update gradle dependencies
|
* Update gradle dependencies
|
||||||
|
|
||||||
## [0.0.3] - 2/8/17
|
## v0.0.3 - 2017-02-8
|
||||||
|
|
||||||
* Improved permission handling (thanks to [BenSower](https://github.com/BenSower))
|
* Improved permission handling (thanks to [BenSower](https://github.com/BenSower))
|
||||||
* Added MIT license
|
* Added MIT license
|
||||||
|
|
||||||
## [0.0.2] - 11/7/17
|
## v0.0.2 - 2017-11-7
|
||||||
|
|
||||||
* Rewrite iOS scanner in Objective-C to avoid Swift use_frameworks! conflicts with other plugins (see https://github.com/flutter/flutter/issues/10968)
|
* Rewrite iOS scanner in Objective-C to avoid Swift use_frameworks! conflicts with other plugins (see https://github.com/flutter/flutter/issues/10968)
|
||||||
|
|
||||||
## [0.0.1] - 10/29/17
|
## v0.0.1 - 2017-10-29
|
||||||
|
|
||||||
* Supports 2D & QR Codes
|
* Supports 2D & QR Codes
|
||||||
* Control flash while scanning
|
* Control flash while scanning
|
||||||
|
3
LICENSE
3
LICENSE
@ -1,6 +1,7 @@
|
|||||||
The MIT License
|
The MIT License
|
||||||
|
|
||||||
Copyright (c) 2018 AppTree Software http://www.apptreesoftware.com
|
Copyright (c) 2020 Julian Finkler https://www.mintware.de
|
||||||
|
Copyright (c) 2018-2019 AppTree Software http://www.apptreesoftware.com
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
61
README.md
61
README.md
@ -1,3 +1,8 @@
|
|||||||
|
[![GitHub license](https://img.shields.io/github/license/mintware-de/flutter_barcode_reader.svg)](https://github.com/mintware-de/flutter_barcode_reader/blob/master/LICENSE)
|
||||||
|
[![GitHub stars](https://img.shields.io/github/stars/mintware-de/flutter_barcode_reader)](https://github.com/mintware-de/flutter_barcode_reader/stargazers)
|
||||||
|
[![Pub](https://img.shields.io/pub/v/barcode_scan.svg)](https://pub.dartlang.org/packages/barcode_scan)
|
||||||
|
[![GitHub forks](https://img.shields.io/github/forks/mintware-de/flutter_barcode_reader)](https://github.com/mintware-de/flutter_barcode_reader/network)
|
||||||
|
|
||||||
# Barcode Scanner
|
# Barcode Scanner
|
||||||
|
|
||||||
A flutter plugin for scanning 2D barcodes and QR codes.
|
A flutter plugin for scanning 2D barcodes and QR codes.
|
||||||
@ -13,7 +18,6 @@ Android: https://github.com/dm77/barcodescanner
|
|||||||
- [x] Scan QR codes
|
- [x] Scan QR codes
|
||||||
- [x] Control the flash while scanning
|
- [x] Control the flash while scanning
|
||||||
- [x] Permission handling
|
- [x] Permission handling
|
||||||
- [ ] Support multiple barcode libraries
|
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
@ -24,44 +28,49 @@ For Android, you must do the following before you can use the plugin:
|
|||||||
|
|
||||||
`<uses-permission android:name="android.permission.CAMERA" />`
|
`<uses-permission android:name="android.permission.CAMERA" />`
|
||||||
|
|
||||||
* Add the BarcodeScanner activity to your AndroidManifest.xml. Do NOT modify the name.
|
|
||||||
|
|
||||||
`<activity android:name="com.apptreesoftware.barcodescan.BarcodeScannerActivity"/>`
|
|
||||||
|
|
||||||
|
|
||||||
* This plugin is written in Kotlin. Therefore, you need to add Kotlin support to your project. See [installing the Kotlin plugin](https://kotlinlang.org/docs/tutorials/kotlin-android.html#installing-the-kotlin-plugin).
|
* This plugin is written in Kotlin. Therefore, you need to add Kotlin support to your project. See [installing the Kotlin plugin](https://kotlinlang.org/docs/tutorials/kotlin-android.html#installing-the-kotlin-plugin).
|
||||||
|
|
||||||
Edit your project-level build.gradle file to look like this:
|
Edit your project-level build.gradle file to look like this:
|
||||||
|
```groovy
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.21'
|
ext.kotlin_version = '1.3.61'
|
||||||
...
|
// ...
|
||||||
dependencies {
|
dependencies {
|
||||||
...
|
// ...
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
...
|
// ...
|
||||||
|
```
|
||||||
|
|
||||||
Edit your app-level build.gradle file to look like this:
|
Edit your app-level build.gradle file to look like this:
|
||||||
|
|
||||||
apply plugin: 'kotlin-android'
|
```groovy
|
||||||
...
|
apply plugin: 'kotlin-android'
|
||||||
dependencies {
|
// ...
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
dependencies {
|
||||||
...
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
}
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Now you can depend on the barcode_scan plugin in your pubspec.yaml file:
|
Now you can depend on the barcode_scan plugin in your pubspec.yaml file:
|
||||||
|
|
||||||
dependencies:
|
```yaml
|
||||||
...
|
dependencies:
|
||||||
barcode_scan: any
|
# ...
|
||||||
|
barcode_scan: any
|
||||||
|
```
|
||||||
Click "Packages get" in Android Studio or run `flutter packages get` in your project folder.
|
Click "Packages get" in Android Studio or run `flutter packages get` in your project folder.
|
||||||
|
|
||||||
### iOS
|
### iOS
|
||||||
To use on iOS, you must add the the camera usage description to your Info.plist
|
To use on iOS, you must add the the camera usage description to your Info.plist
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<dict>
|
||||||
|
<!-- ... -->
|
||||||
<key>NSCameraUsageDescription</key>
|
<key>NSCameraUsageDescription</key>
|
||||||
<string>Camera permission is required for barcode scanning.</string>
|
<string>Camera permission is required for barcode scanning.</string>
|
||||||
|
<!-- ... -->
|
||||||
|
</dict>
|
||||||
|
```
|
25
UPGRADE.md
Normal file
25
UPGRADE.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Upgrade from 1.0.0 to 2.0.0
|
||||||
|
|
||||||
|
The simples way for upgrading is by replacing:
|
||||||
|
- `com.apptreesoftware.barcodescan`
|
||||||
|
- `com.yourcompany.barcodescan`
|
||||||
|
- `com.apptreesoftware.barcode_scan`
|
||||||
|
|
||||||
|
With: `de.mintware.barcode_scan`
|
||||||
|
|
||||||
|
Detailed changes:
|
||||||
|
Android:
|
||||||
|
Kotlin Package: `com.apptreesoftware.barcodescan` -> `de.mintware.barcode_scan`
|
||||||
|
Manifest-Package: `com.yourcompany.barcodescan` -> `de.mintware.barcodescan`
|
||||||
|
Activity: `com.apptreesoftware.barcodescan.BarcodeScannerActivity` -> `de.mintware.barcode_scan.BarcodeScannerActivity`
|
||||||
|
|
||||||
|
iOS:
|
||||||
|
Bundle ID: `com.apptreesoftware.barcode.plugin.example` -> `de.mintware.barcode_scan.plugin.example`
|
||||||
|
|
||||||
|
Flutter:
|
||||||
|
Method channel: `com.apptreesoftware.barcode_scan` -> `de.mintware.barcode_scan`
|
||||||
|
pubspec.yaml:
|
||||||
|
- homepage updated
|
||||||
|
- deprecated author entry removed
|
||||||
|
- comments removed
|
||||||
|
- flutter.plugin.androidPackage: `com.apptreesoftware.barcode_scan` -> `de.mintware.barcode_scan`
|
@ -1,4 +1,6 @@
|
|||||||
group 'com.apptreesoftware.barcodescan'
|
package android
|
||||||
|
|
||||||
|
group 'de.mintware.barcode_scan'
|
||||||
version '1.0-SNAPSHOT'
|
version '1.0-SNAPSHOT'
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
@ -9,7 +11,7 @@ buildscript {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.yourcompany.barcodescan">
|
package="de.mintware.barcodescan">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|
||||||
<application>
|
<application>
|
||||||
<activity android:name="com.apptreesoftware.barcodescan.BarcodeScannerActivity" />
|
<activity android:name="de.mintware.barcode_scan.BarcodeScannerActivity" />
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.apptreesoftware.barcodescan
|
package de.mintware.barcode_scan
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@ -16,7 +16,7 @@ class BarcodeScanPlugin(private val registrar: Registrar) : MethodCallHandler, P
|
|||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun registerWith(registrar: Registrar) {
|
fun registerWith(registrar: Registrar) {
|
||||||
val channel = MethodChannel(registrar.messenger(), "com.apptreesoftware.barcode_scan")
|
val channel = MethodChannel(registrar.messenger(), "de.mintware.barcode_scan")
|
||||||
val plugin = BarcodeScanPlugin(registrar)
|
val plugin = BarcodeScanPlugin(registrar)
|
||||||
channel.setMethodCallHandler(plugin)
|
channel.setMethodCallHandler(plugin)
|
||||||
registrar.addActivityResultListener(plugin)
|
registrar.addActivityResultListener(plugin)
|
@ -1,4 +1,4 @@
|
|||||||
package com.apptreesoftware.barcodescan
|
package de.mintware.barcode_scan
|
||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.app.Activity
|
import android.app.Activity
|
5
example/.gitignore
vendored
5
example/.gitignore
vendored
@ -8,3 +8,8 @@ ios/.generated/
|
|||||||
packages
|
packages
|
||||||
pubspec.lock
|
pubspec.lock
|
||||||
.flutter-plugins
|
.flutter-plugins
|
||||||
|
.flutter-plugins-dependencies
|
||||||
|
ios/Flutter.podspec
|
||||||
|
ios/Flutter/Flutter.podspec
|
||||||
|
ios/Flutter/flutter_export_environment.sh
|
||||||
|
ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
|
@ -29,12 +29,12 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
applicationId "com.yourcompany.barcodescanexample"
|
applicationId "de.mintware.barcode_scan_example"
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.yourcompany.barcodescanexample">
|
package="de.mintware.barcode_scan_example">
|
||||||
|
|
||||||
<!-- The INTERNET permission is required for development. Specifically,
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
flutter needs it to communicate with the running application
|
flutter needs it to communicate with the running application
|
||||||
@ -16,7 +16,7 @@
|
|||||||
android:label="barcode_scan_example"
|
android:label="barcode_scan_example"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
android:name="com.apptreesoftware.barcodescanexample.MainActivity"
|
android:name="de.mintware.barcode_scan_example.MainActivity"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.apptreesoftware.barcodescanexample
|
package de.mintware.barcode_scan_example
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
|
||||||
|
@ -1 +1,4 @@
|
|||||||
org.gradle.jvmargs=-Xmx1536M
|
org.gradle.jvmargs=-Xmx1536M
|
||||||
|
android.enableR8=true
|
||||||
|
android.useAndroidX=true
|
||||||
|
android.enableJetifier=true
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
PODS:
|
|
||||||
- barcode_scan (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- MTBBarcodeScanner
|
|
||||||
- Flutter (1.0.0)
|
|
||||||
- MTBBarcodeScanner (5.0.11)
|
|
||||||
|
|
||||||
DEPENDENCIES:
|
|
||||||
- barcode_scan (from `/Users/matthew/AppTree/plugins/barcode_scan/ios`)
|
|
||||||
- Flutter (from `/Users/matthew/Library/flutter/bin/cache/artifacts/engine/ios`)
|
|
||||||
|
|
||||||
SPEC REPOS:
|
|
||||||
https://github.com/cocoapods/specs.git:
|
|
||||||
- MTBBarcodeScanner
|
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
|
||||||
barcode_scan:
|
|
||||||
:path: "/Users/matthew/AppTree/plugins/barcode_scan/ios"
|
|
||||||
Flutter:
|
|
||||||
:path: "/Users/matthew/Library/flutter/bin/cache/artifacts/engine/ios"
|
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
|
||||||
barcode_scan: 33f586d02270046fc6559135038b34b5754eaa4f
|
|
||||||
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
|
|
||||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
|
||||||
|
|
||||||
PODFILE CHECKSUM: 407db753d18e8726329521f96a8fa0bebaef3f42
|
|
||||||
|
|
||||||
COCOAPODS: 1.6.1
|
|
@ -180,7 +180,6 @@
|
|||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
97C146ED1CF9000F007C117D = {
|
97C146ED1CF9000F007C117D = {
|
||||||
CreatedOnToolsVersion = 7.3.1;
|
CreatedOnToolsVersion = 7.3.1;
|
||||||
DevelopmentTeam = RTZBJSE8E8;
|
|
||||||
LastSwiftMigration = 0830;
|
LastSwiftMigration = 0830;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -274,7 +273,7 @@
|
|||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
|
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
|
||||||
"${PODS_ROOT}/../../../../../../Library/flutter/bin/cache/artifacts/engine/ios/Flutter.framework",
|
"${PODS_ROOT}/../../../../../development/flutter/bin/cache/artifacts/engine/ios/Flutter.framework",
|
||||||
);
|
);
|
||||||
name = "[CP] Embed Pods Frameworks";
|
name = "[CP] Embed Pods Frameworks";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
@ -416,7 +415,6 @@
|
|||||||
ARCHS = arm64;
|
ARCHS = arm64;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
DEVELOPMENT_TEAM = RTZBJSE8E8;
|
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@ -428,7 +426,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Flutter",
|
"$(PROJECT_DIR)/Flutter",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.apptreesoftware.barcode.plugin.example;
|
PRODUCT_BUNDLE_IDENTIFIER = de.mintware.barcode_scan.plugin.example;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
@ -443,7 +441,6 @@
|
|||||||
ARCHS = arm64;
|
ARCHS = arm64;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
DEVELOPMENT_TEAM = RTZBJSE8E8;
|
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
FRAMEWORK_SEARCH_PATHS = (
|
FRAMEWORK_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@ -455,7 +452,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)/Flutter",
|
"$(PROJECT_DIR)/Flutter",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.apptreesoftware.barcode.plugin.example;
|
PRODUCT_BUNDLE_IDENTIFIER = de.mintware.barcode_scan.plugin.example;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 4.0;
|
SWIFT_VERSION = 4.0;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
@implementation BarcodeScanPlugin
|
@implementation BarcodeScanPlugin
|
||||||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
|
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
|
||||||
FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:@"com.apptreesoftware.barcode_scan"
|
FlutterMethodChannel *channel = [FlutterMethodChannel methodChannelWithName:@"de.mintware.barcode_scan"
|
||||||
binaryMessenger:registrar.messenger];
|
binaryMessenger:registrar.messenger];
|
||||||
BarcodeScanPlugin *instance = [BarcodeScanPlugin new];
|
BarcodeScanPlugin *instance = [BarcodeScanPlugin new];
|
||||||
instance.hostViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
instance.hostViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
||||||
@ -22,10 +22,12 @@
|
|||||||
- (void)showBarcodeView {
|
- (void)showBarcodeView {
|
||||||
BarcodeScannerViewController *scannerViewController = [[BarcodeScannerViewController alloc] init];
|
BarcodeScannerViewController *scannerViewController = [[BarcodeScannerViewController alloc] init];
|
||||||
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:scannerViewController];
|
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:scannerViewController];
|
||||||
|
if (@available(iOS 13.0, *)) {
|
||||||
|
[navigationController setModalPresentationStyle:UIModalPresentationFullScreen];
|
||||||
|
}
|
||||||
scannerViewController.delegate = self;
|
scannerViewController.delegate = self;
|
||||||
[self.hostViewController presentViewController:navigationController animated:NO completion:nil];
|
[self.hostViewController presentViewController:navigationController animated:NO completion:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)barcodeScannerViewController:(BarcodeScannerViewController *)controller didScanBarcodeWithResult:(NSString *)result {
|
- (void)barcodeScannerViewController:(BarcodeScannerViewController *)controller didScanBarcodeWithResult:(NSString *)result {
|
||||||
if (self.result) {
|
if (self.result) {
|
||||||
self.result(result);
|
self.result(result);
|
||||||
|
@ -2,10 +2,22 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
/// Barcode scanner plugin
|
||||||
|
/// Simply call `var barcode = await BarcodeScanner.scan()` to scan a barcode
|
||||||
class BarcodeScanner {
|
class BarcodeScanner {
|
||||||
|
/// If the user has not granted the access to the camera this code is thrown.
|
||||||
static const CameraAccessDenied = 'PERMISSION_NOT_GRANTED';
|
static const CameraAccessDenied = 'PERMISSION_NOT_GRANTED';
|
||||||
|
|
||||||
|
/// If the user cancel the scan an exception with this code is thrown.
|
||||||
static const UserCanceled = 'USER_CANCELED';
|
static const UserCanceled = 'USER_CANCELED';
|
||||||
|
|
||||||
|
/// The method channel
|
||||||
static const MethodChannel _channel =
|
static const MethodChannel _channel =
|
||||||
const MethodChannel('com.apptreesoftware.barcode_scan');
|
const MethodChannel('de.mintware.barcode_scan');
|
||||||
|
|
||||||
|
/// Starts the camera for scanning the barcode, shows a preview window and
|
||||||
|
/// returns the barcode if one was scanned.
|
||||||
|
/// Can throw an exception.
|
||||||
|
/// See also [CameraAccessDenied] and [UserCanceled]
|
||||||
static Future<String> scan() async => await _channel.invokeMethod('scan');
|
static Future<String> scan() async => await _channel.invokeMethod('scan');
|
||||||
}
|
}
|
||||||
|
42
pubspec.yaml
42
pubspec.yaml
@ -1,8 +1,7 @@
|
|||||||
name: barcode_scan
|
name: barcode_scan
|
||||||
description: A flutter plugin for scanning 2D barcodes and QRCodes via camera.
|
description: A flutter plugin for scanning 2D barcodes and QRCodes via camera.
|
||||||
version: 1.0.0
|
version: 2.0.0
|
||||||
author: Matthew Smith<matthew.smith@apptreesoftware.com>
|
homepage: https://github.com/mintware-de/flutter_barcode_reader
|
||||||
homepage: https://github.com/apptreesoftware/flutter_barcode_reader
|
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
@ -11,42 +10,7 @@ dependencies:
|
|||||||
environment:
|
environment:
|
||||||
sdk: ">=2.0.0-dev.58.0 <3.0.0"
|
sdk: ">=2.0.0-dev.58.0 <3.0.0"
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
|
||||||
# following page: https://www.dartlang.org/tools/pub/pubspec
|
|
||||||
|
|
||||||
# The following section is specific to Flutter.
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
androidPackage: com.apptreesoftware.barcodescan
|
androidPackage: de.mintware.barcode_scan
|
||||||
pluginClass: BarcodeScanPlugin
|
pluginClass: BarcodeScanPlugin
|
||||||
|
|
||||||
# To add assets to your plugin package, add an assets section, like this:
|
|
||||||
# assets:
|
|
||||||
# - images/a_dot_burr.jpeg
|
|
||||||
# - images/a_dot_ham.jpeg
|
|
||||||
#
|
|
||||||
# For details regarding assets in packages, see
|
|
||||||
# https://flutter.io/assets-and-images/#from-packages
|
|
||||||
#
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
|
||||||
# https://flutter.io/assets-and-images/#resolution-aware.
|
|
||||||
|
|
||||||
# To add custom fonts to your plugin package, add a fonts section here,
|
|
||||||
# in this "flutter" section. Each entry in this list should have a
|
|
||||||
# "family" key with the font family name, and a "fonts" key with a
|
|
||||||
# list giving the asset and other descriptors for the font. For
|
|
||||||
# example:
|
|
||||||
# fonts:
|
|
||||||
# - family: Schyler
|
|
||||||
# fonts:
|
|
||||||
# - asset: fonts/Schyler-Regular.ttf
|
|
||||||
# - asset: fonts/Schyler-Italic.ttf
|
|
||||||
# style: italic
|
|
||||||
# - family: Trajan Pro
|
|
||||||
# fonts:
|
|
||||||
# - asset: fonts/TrajanPro.ttf
|
|
||||||
# - asset: fonts/TrajanPro_Bold.ttf
|
|
||||||
# weight: 700
|
|
||||||
#
|
|
||||||
# For details regarding fonts in packages, see
|
|
||||||
# https://flutter.io/custom-fonts/#from-packages
|
|
||||||
|
Loading…
Reference in New Issue
Block a user