From 892a13f7c1b592e329b72f8871e858b51ec18781 Mon Sep 17 00:00:00 2001 From: Amol Gangadhare Date: Wed, 6 Jan 2021 02:31:28 +0530 Subject: [PATCH 1/2] Release 1.0.2 --- .idea/libraries/Flutter_Plugins.xml | 2 +- .idea/workspace.xml | 52 +++++++++---------- CHANGELOG.md | 5 ++ README.md | 2 +- .../camera/CameraSource.java | 8 +-- .../src/main/res/layout/barcode_capture.xml | 4 +- example/.flutter-plugins-dependencies | 2 +- .../ios/Flutter/flutter_export_environment.sh | 9 ++-- example/ios/Runner.xcodeproj/project.pbxproj | 6 +-- ios/flutter_barcode_scanner.podspec | 2 +- pubspec.yaml | 2 +- 11 files changed, 51 insertions(+), 43 deletions(-) diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml index 078a1dcc..123c1e55 100644 --- a/.idea/libraries/Flutter_Plugins.xml +++ b/.idea/libraries/Flutter_Plugins.xml @@ -2,7 +2,7 @@ - + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4b9cd55b..87527aa3 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -10,13 +10,28 @@ + + + + + + + + + + + + + + + + - + diff --git a/CHANGELOG.md b/CHANGELOG.md index 52362260..161076b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.0.2 + +* Android: Fixes #137 and #132 +* iOS: Fixes #97 + ## 1.0.1 * Merge PR #90 diff --git a/README.md b/README.md index 11cad7aa..fa97ddfb 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ After making the changes in Android ans iOS add flutter_barcode_scanner to `pubs ``` dependencies: ... - flutter_barcode_scanner: ^1.0.1 + flutter_barcode_scanner: ^1.0.2 ``` ### One time scan diff --git a/android/src/main/java/com/amolg/flutterbarcodescanner/camera/CameraSource.java b/android/src/main/java/com/amolg/flutterbarcodescanner/camera/CameraSource.java index 90dfa3cc..5cd177c5 100755 --- a/android/src/main/java/com/amolg/flutterbarcodescanner/camera/CameraSource.java +++ b/android/src/main/java/com/amolg/flutterbarcodescanner/camera/CameraSource.java @@ -964,9 +964,11 @@ private class FrameProcessingRunnable implements Runnable { @SuppressLint("Assert") void release() { - assert (mProcessingThread.getState() == State.TERMINATED); - mDetector.release(); - mDetector = null; + assert (mProcessingThread == null || mProcessingThread.getState() == State.TERMINATED); + if (mDetector != null) { + mDetector.release(); + mDetector = null; + } } void setActive(boolean active) { diff --git a/android/src/main/res/layout/barcode_capture.xml b/android/src/main/res/layout/barcode_capture.xml index d39b66e1..7850256e 100755 --- a/android/src/main/res/layout/barcode_capture.xml +++ b/android/src/main/res/layout/barcode_capture.xml @@ -28,8 +28,8 @@ diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 82a60f3f..397f9a4e 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_barcode_scanner","path":"/Volumes/MyData/Projects/flutter_barcode_scanner/","dependencies":[]}],"android":[{"name":"flutter_barcode_scanner","path":"/Volumes/MyData/Projects/flutter_barcode_scanner/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"/Volumes/MyData/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.7/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_barcode_scanner","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]}],"date_created":"2020-05-15 21:46:36.882926","version":"1.17.1"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_barcode_scanner","path":"/Volumes/MyData/Projects/flutter_barcode_scanner_stable/flutter_barcode_scanner/","dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"/Volumes/MyData/Flutter_SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.11/","dependencies":[]},{"name":"flutter_barcode_scanner","path":"/Volumes/MyData/Projects/flutter_barcode_scanner_stable/flutter_barcode_scanner/","dependencies":["flutter_plugin_android_lifecycle"]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_barcode_scanner","dependencies":["flutter_plugin_android_lifecycle"]}],"date_created":"2021-01-06 01:40:53.149426","version":"1.24.0-10.2.pre"} \ No newline at end of file diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh index 4de76aaf..a97405b3 100755 --- a/example/ios/Flutter/flutter_export_environment.sh +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -1,12 +1,15 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. export "FLUTTER_ROOT=/Volumes/MyData/Flutter_SDK/flutter" -export "FLUTTER_APPLICATION_PATH=/Volumes/MyData/Projects/flutter_barcode_scanner/example" -export "FLUTTER_TARGET=/Volumes/MyData/Projects/flutter_barcode_scanner/example/lib/main.dart" +export "FLUTTER_APPLICATION_PATH=/Volumes/MyData/Projects/flutter_barcode_scanner_stable/flutter_barcode_scanner/example" +export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" export "SYMROOT=${SOURCE_ROOT}/../build/ios" export "OTHER_LDFLAGS=$(inherited) -framework Flutter" export "FLUTTER_FRAMEWORK_DIR=/Volumes/MyData/Flutter_SDK/flutter/bin/cache/artifacts/engine/ios" export "FLUTTER_BUILD_NAME=1.0.1" export "FLUTTER_BUILD_NUMBER=1.0.1" -export "TRACK_WIDGET_CREATION=true" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.packages" diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 53578d2b..69ae828e 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -381,7 +381,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.amolg.flutterBarcodeScannerExample20; + PRODUCT_BUNDLE_IDENTIFIER = com.amolg.flutterBarcodeScannerExample2021; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; @@ -524,7 +524,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.amolg.flutterBarcodeScannerExample20; + PRODUCT_BUNDLE_IDENTIFIER = com.amolg.flutterBarcodeScannerExample2021; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -557,7 +557,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.amolg.flutterBarcodeScannerExample20; + PRODUCT_BUNDLE_IDENTIFIER = com.amolg.flutterBarcodeScannerExample2021; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/ios/flutter_barcode_scanner.podspec b/ios/flutter_barcode_scanner.podspec index 3d0c122a..31fef243 100644 --- a/ios/flutter_barcode_scanner.podspec +++ b/ios/flutter_barcode_scanner.podspec @@ -3,7 +3,7 @@ # Pod::Spec.new do |s| s.name = 'flutter_barcode_scanner' - s.version = '1.0.1' + s.version = '1.0.2' s.summary = 'A new Flutter plugin supports barcode scanning on both Android and iOS.' s.description = <<-DESC A new Flutter plugin supports barcode scanning on both Android and iOS. diff --git a/pubspec.yaml b/pubspec.yaml index 72c85050..efdcfece 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_barcode_scanner description: A plugin for barcode scanning support on Android and iOS. Supports barcodes, QR codes, etc. -version: 1.0.1 +version: 1.0.2 author: Amol Gangadhare homepage: https://github.com/AmolGangadhare/flutter_barcode_scanner From ad87071448f8afbeac90cad5519fa880d3c28d42 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 31 Mar 2021 12:16:43 +0800 Subject: [PATCH 2/2] stop video capture after UIViewController popped on iOS --- ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift b/ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift index 5fbf9012..37ff61df 100644 --- a/ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift +++ b/ios/Classes/SwiftFlutterBarcodeScannerPlugin.swift @@ -221,6 +221,11 @@ class BarcodeScannerViewController: UIViewController { super.viewWillAppear(animated) self.moveVertically() } + + override public func viewDidDisappear(_ animated: Bool){ + // Stop video capture + captureSession.stopRunning() + } // Init UI components needed func initUIComponents(){