Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: juliansteenbakker/mobile_scanner
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.5
Choose a base ref
...
head repository: juliansteenbakker/mobile_scanner
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref

Commits on Oct 12, 2024

  1. Copy the full SHA
    dff1935 View commit details
  2. Copy the full SHA
    740b720 View commit details
  3. Clean up

    RafaRuiz committed Oct 12, 2024
    Copy the full SHA
    ebfe698 View commit details

Commits on Oct 14, 2024

  1. Update lib/src/objects/start_options.dart

    Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
    RafaRuiz and navaronbracke authored Oct 14, 2024
    Copy the full SHA
    b1bb926 View commit details
  2. Update lib/src/mobile_scanner_controller.dart

    Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
    RafaRuiz and navaronbracke authored Oct 14, 2024
    Copy the full SHA
    25e52d7 View commit details
  3. Update android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileS…

    …canner.kt
    
    Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
    RafaRuiz and navaronbracke authored Oct 14, 2024
    Copy the full SHA
    88b7b67 View commit details
  4. Update ios/Classes/MobileScanner.swift

    Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
    RafaRuiz and navaronbracke authored Oct 14, 2024
    Copy the full SHA
    89d0f20 View commit details

Commits on Oct 18, 2024

  1. Rename feature

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    5ceb867 View commit details
  2. Rename methods and variables

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    989f441 View commit details
  3. Wording

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    71d1e83 View commit details
  4. Copy the full SHA
    1e76615 View commit details
  5. Copy the full SHA
    c8f48b2 View commit details
  6. redundant temp variable

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    96becf0 View commit details
  7. rename var

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    d8512f4 View commit details
  8. let

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    62a728d View commit details
  9. private

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    638c94b View commit details
  10. CIFilter magic string

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    b7080a6 View commit details
  11. Copy the full SHA
    47f8155 View commit details
  12. let uiimage

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    c1313ef View commit details
  13. make CIFilter API available

    RafaRuiz committed Oct 18, 2024
    Copy the full SHA
    ebae80d View commit details

Commits on Oct 23, 2024

  1. Copy the full SHA
    7db2758 View commit details
  2. Copy the full SHA
    ae98432 View commit details
  3. Copy the full SHA
    02476e3 View commit details
  4. include iOS for SPM

    navaronbracke committed Oct 23, 2024
    Copy the full SHA
    7f1ed93 View commit details
  5. Copy the full SHA
    15d26be View commit details
  6. Copy the full SHA
    9341b05 View commit details
  7. Copy the full SHA
    54aea94 View commit details
  8. Copy the full SHA
    6f2103a View commit details
  9. Copy the full SHA
    6c0f2b5 View commit details
  10. Copy the full SHA
    75bb9d4 View commit details
  11. Copy the full SHA
    66a3b65 View commit details
  12. Copy the full SHA
    73c9589 View commit details

Commits on Oct 24, 2024

  1. Merge pull request #1228 from navaronbracke/ios-vision-feedback

    feat: Vision API fixes
    juliansteenbakker authored Oct 24, 2024
    Copy the full SHA
    c4a300b View commit details

Commits on Oct 28, 2024

  1. Copy the full SHA
    c5f90f0 View commit details
  2. Copy the full SHA
    8e9e41a View commit details
  3. Copy the full SHA
    9f9ad4b View commit details
  4. Copy the full SHA
    c4ba195 View commit details
  5. Copy the full SHA
    d74d7a5 View commit details
  6. Copy the full SHA
    bdc6d03 View commit details
  7. Copy the full SHA
    3cb016d View commit details

Commits on Oct 29, 2024

  1. Copy the full SHA
    ef32e33 View commit details
  2. Copy the full SHA
    2f79daf View commit details
  3. Copy the full SHA
    be47302 View commit details
  4. feat: add basic ui elements for barcode overlay and scanner overlay, …

    …update scanWindow via MobileScanner widget
    juliansteenbakker committed Oct 29, 2024
    Copy the full SHA
    b7d6599 View commit details

Commits on Nov 7, 2024

  1. Copy the full SHA
    a992e1a View commit details
  2. Copy the full SHA
    86d216d View commit details
  3. Copy the full SHA
    5dbe5fc View commit details
  4. Copy the full SHA
    d328a6c View commit details
  5. Copy the full SHA
    cc01485 View commit details
  6. Copy the full SHA
    910d280 View commit details
Showing with 2,636 additions and 2,214 deletions.
  1. +60 −0 .github/workflows/code-coverage.yml
  2. +65 −0 .github/workflows/code-quality.yml
  3. +0 −59 .github/workflows/flutter.yml
  4. +4 −0 .gitignore
  5. +101 −0 CHANGELOG.md
  6. +1 −3 README.md
  7. +3 −1 analysis_options.yaml
  8. +8 −8 android/build.gradle
  9. +7 −0 android/gradle/wrapper/gradle-wrapper.properties
  10. +4 −0 android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeHandler.kt
  11. +122 −0 android/src/main/kotlin/dev/steenbakker/mobile_scanner/DeviceOrientationListener.kt
  12. +249 −114 android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt
  13. +81 −19 android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt
  14. +2 −0 android/src/main/kotlin/dev/steenbakker/mobile_scanner/objects/MobileScannerErrorCodes.kt
  15. +5 −1 android/src/main/kotlin/dev/steenbakker/mobile_scanner/objects/MobileScannerStartParameters.kt
  16. +16 −0 android/src/main/kotlin/dev/steenbakker/mobile_scanner/utils/DeviceOrientationExtension.kt
  17. +2 −4 android/src/main/kotlin/dev/steenbakker/mobile_scanner/utils/Yuv.kt
  18. +3 −1 android/src/main/kotlin/dev/steenbakker/mobile_scanner/utils/YuvToRgbConverter.kt
  19. +10 −7 {macos → darwin}/mobile_scanner.podspec
  20. +1 −0 {macos → darwin}/mobile_scanner/Package.swift
  21. 0 {ios/Classes → darwin/mobile_scanner/Sources/mobile_scanner}/DetectionSpeed.swift
  22. 0 {ios/Classes → darwin/mobile_scanner/Sources/mobile_scanner}/MobileScannerError.swift
  23. +6 −7 {ios/Classes → darwin/mobile_scanner/Sources/mobile_scanner}/MobileScannerErrorCodes.swift
  24. +408 −118 {macos → darwin}/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift
  25. 0 {ios → darwin/mobile_scanner/Sources/mobile_scanner}/Resources/PrivacyInfo.xcprivacy
  26. +2 −0 example/android/.gitignore
  27. +3 −2 example/android/app/build.gradle
  28. +1 −1 example/ios/Flutter/AppFrameworkInfo.plist
  29. +1 −1 example/ios/Podfile
  30. +68 −64 example/ios/Runner.xcodeproj/project.pbxproj
  31. +18 −0 example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  32. +13 −41 example/lib/barcode_scanner_controller.dart
  33. +0 −101 example/lib/barcode_scanner_listview.dart
  34. +2 −2 example/lib/barcode_scanner_pageview.dart
  35. +2 −2 example/lib/barcode_scanner_returning_image.dart
  36. +1 −1 example/lib/barcode_scanner_simple.dart
  37. +102 −193 example/lib/barcode_scanner_window.dart
  38. +2 −2 example/lib/barcode_scanner_zoom.dart
  39. +0 −6 example/lib/main.dart
  40. +6 −68 example/lib/mobile_scanner_overlay.dart
  41. +1 −1 example/lib/picklist/barcode_scanner_picklist.dart
  42. +3 −1 example/lib/scanned_barcode_label.dart
  43. +4 −0 example/lib/scanner_button_widgets.dart
  44. +0 −1 example/lib/scanner_error_widget.dart
  45. +20 −0 example/macos/Runner.xcodeproj/project.pbxproj
  46. +18 −0 example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  47. +3 −3 example/pubspec.yaml
  48. +0 −38 ios/.gitignore
  49. 0 ios/Assets/.gitkeep
  50. +0 −44 ios/Classes/BarcodeHandler.swift
  51. +0 −519 ios/Classes/MobileScanner.swift
  52. +0 −315 ios/Classes/MobileScannerPlugin.swift
  53. +0 −134 ios/Classes/MobileScannerUtilities.swift
  54. +0 −30 ios/mobile_scanner.podspec
  55. +6 −0 lib/mobile_scanner.dart
  56. +21 −7 lib/src/enums/camera_facing.dart
  57. +0 −5 lib/src/enums/encryption_type.dart
  58. +64 −0 lib/src/method_channel/android_surface_producer_delegate.dart
  59. +68 −1 lib/src/method_channel/mobile_scanner_method_channel.dart
  60. +130 −0 lib/src/method_channel/rotated_preview.dart
  61. +11 −15 lib/src/mobile_scanner.dart
  62. +58 −25 lib/src/mobile_scanner_controller.dart
  63. +6 −0 lib/src/mobile_scanner_exception.dart
  64. +7 −1 lib/src/mobile_scanner_view_attributes.dart
  65. +9 −3 lib/src/objects/barcode.dart
  66. +5 −2 lib/src/objects/mobile_scanner_state.dart
  67. +12 −4 lib/src/objects/start_options.dart
  68. +77 −0 lib/src/overlay/barcode_overlay.dart
  69. +133 −0 lib/src/overlay/barcode_painter.dart
  70. +95 −0 lib/src/overlay/scan_window_overlay.dart
  71. +96 −0 lib/src/overlay/scan_window_painter.dart
  72. +23 −0 lib/src/utils/parse_device_orientation_extension.dart
  73. +18 −6 lib/src/web/barcode_reader.dart
  74. +4 −0 lib/src/web/javascript_map.dart
  75. +27 −10 lib/src/web/media_track_constraints_delegate.dart
  76. +9 −8 lib/src/web/media_track_extension.dart
  77. +33 −24 lib/src/web/mobile_scanner_web.dart
  78. +2 −0 lib/src/web/zxing/result.dart
  79. +6 −2 lib/src/web/zxing/zxing_barcode_reader.dart
  80. +3 −0 lib/src/web/zxing/zxing_browser_multi_format_reader.dart
  81. +0 −12 macos/mobile_scanner/Sources/mobile_scanner/DetectionSpeed.swift
  82. +0 −21 macos/mobile_scanner/Sources/mobile_scanner/MobileScannerErrorCodes.swift
  83. +0 −13 macos/mobile_scanner/Sources/mobile_scanner/Resources/PrivacyInfo.xcprivacy
  84. +6 −3 pubspec.yaml
  85. +12 −7 test/enums/camera_facing_test.dart
  86. +51 −0 test/parse_device_orientation_test.dart
  87. +216 −133 test/scan_window_test.dart
60 changes: 60 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 📊 Code Coverage

on: [push, pull_request]

env:
PUB_ENVIRONMENT: bot.github

jobs:
test_with_coverage:
name: 🧪 Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
# Checkout the Repository
- name: 📥 Checkout Repository
uses: actions/checkout@v4

# Setup Flutter SDK with Cache
- name: ⚡ Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

# Cache Pub Dependencies
- name: 📦 Cache Pub Dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-
# Install Project Dependencies
- name: 🚀 Install Dependencies
run: flutter pub get

# Run Tests with Code Coverage
- name: ✅ Run Unit Tests with Coverage
run: flutter test --coverage

# Upload Coverage Report as Artifact
- name: 📊 Upload Coverage Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/lcov.info

# Upload Coverage to Codecov
- name: ☁️ Upload Coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
flags: unittests
name: codecov-flutter
fail_ci_if_error: true
65 changes: 65 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 📝 Code Quality

on: [push, pull_request]

defaults:
run:
shell: bash

env:
PUB_ENVIRONMENT: bot.github

jobs:
analysis:
name: 🔍 Analysis
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout Code
uses: actions/checkout@v4

- name: ⚡ Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- name: 🔍 Flutter Version Info
run: flutter doctor -v

- name: 📦 Cache Pub Dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-
- name: 🔧 Bootstrap Workspace
run: flutter pub get

- name: ✅ Lint Code
run: flutter analyze

formatting:
name: 🎨 Formatting
needs: analysis # This makes formatting start after analysis is complete
runs-on: ubuntu-latest

steps:
- name: 📥 Checkout Code
uses: actions/checkout@v4

- name: ⚡ Set Up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- name: 🔧 Bootstrap Workspace
run: flutter pub get

- name: 🎯 Check Code Formatting
run: dart format --set-exit-if-changed .
59 changes: 0 additions & 59 deletions .github/workflows/flutter.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -104,6 +104,10 @@ unlinked_spec.ds
**/macos/Flutter/GeneratedPluginRegistrant.swift
**/macos/Flutter/ephemeral

# Swift Package Manager related
.build/
.swiftpm/

# Coverage
coverage/

101 changes: 101 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,104 @@
## 7.0.0-beta.7

**BREAKING CHANGES:**

* The initial state of the `MobileScannerState` camera facing direction is changed to `CameraFacing.unknown`.

Improvements:
* [Android] Turn off logging for CameraX, except for the `Log.ERROR` logging level.
* Added `CameraFacing.external` and `CameraFacing.unknown` enum values.

Bugs fixed:
* [Android] Fixed an issue when compiling with Kotlin 1.8.0 or higher.

## 7.0.0-beta.6

**BREAKING CHANGES:**

* This release requires Flutter 3.27.0 or higher.

Improvements:
* [Android] Added support for Impeller.
* [Apple] Added support for `rawBytes` from the Vision API observations.
* Export the `MobileScannerViewAttributes` and `StartOptions` types, to allow them in tests.

Bugs fixed:
* [Apple] Fixed a bug that caused a crash when the capture session could not add the video input.

## 7.0.0-beta.5

Improvements:
* [Android] Added `autoZoom` parameter to auto zoom if the detected code is to far from the camera.
* [Android] Added `invertImage` parameter to invert image colors for analyzer to support white-on-black barcodes, which are not supported by MLKit.
* [Android] Updated camera-camera2 dependencies.
* Added pause functionality to all platforms.

Bugs fixed:
* [Android] Fixed resources not being closed.

## 7.0.0-beta.4

**BREAKING CHANGES:**

* The `updateScanWindow` method is now private. Instead, update the scan window in the `MobileScanner` widget directly.
* The deprecated `EncryptionType.none` constant has been removed. Use `EncryptionType.unknown` instead.
* The `errorBuilder` and `placeholderBuilder` of the `MobileScanner` widget no longer take a Widget argument, as it was unused.
* The `MobileScannerErrorBuilder` typedef has been removed.

Bugs fixed:
* [Apple] Fixed an issue which caused the scanWindow to always be present, even when reset to no value.
* [Apple] Fixed an issue that caused the barcode size to report the wrong height.
* [Apple] Fixed a bug that caused the corner points to not be returned in clockwise orientation.
* [Apple] Fixed an issue where `analyzeImage` would not throw an error if no valid image is provided as argument.
* [Apple] Fixed an issue where `analyzeImage` would not return if no barcodes are found in the image.
* [Apple] Fixed an issue where the iOS Simulator did not report that analyzing images from a file is unsupported.
* [Android] Fixed an issue where `analyzeImage` would not return if no valid image is provided as argument.

Improvements:
* Added a basic barcode overlay widget, for use with the camera preview.
* Added a basic scan window overlay widget, for use with the camera preview.
* Update the bundled MLKit model for Android to version `17.3.0`.
* Added documentation in places where it was missing.
* Added `color` and `style` properties to the `BarcodePainter` widget.
* Enabled Swift Package Manager for the example app.

## 7.0.0-beta.3

* Fixed a build issue on macOS.

## 7.0.0-beta.2

Bugs fixed:
* [Apple] Fixed an issue with the zoom slider being non-functional.
* [Apple] Fixed an issue where the flash would briefly show when the camera is turned on.
* [Apple] Fixed an issue that prevented the scan window from working.
* [Apple] Fixed an issue that caused the barcode overlay to use the wrong dimensions.

Improvements:
* [iOS] Adds support for Swift Package Manager.

Known issues:
* BoxFit.cover & BoxFit.fitHeight produce the wrong width in the barcode overlay.

## 7.0.0-beta.1

Improvements:
* [iOS] Migrate to the Vision API.
* [iOS] Updated the minimum iOS version back down to 12.0.
* [Apple] Merged the iOS and MacOS sources.

Known issues:
* [Apple] The zoom slider does not work correctly.
* [Apple] The scan window does not work correctly.
* [Apple] The camera flash briefly shows when the camera is started.

## 6.0.6
Bugs fixed:
* [web] Fixed a bug that prevented color inverted barcodes from being scanned.

Improvements:
* [web] Bump ZXingJS from version 0.19.1 to 0.21.3.

## 6.0.5
Bugs fixed:
* [Android] Fixed crash due to imageProxy being closed too early.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ See the example app for detailed implementation information.
| analyzeImage (Gallery) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
| returnImage | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
| scanWindow | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
| autoZoom | :heavy_check_mark: | :x: | :x: | :x: |

## Platform Support

@@ -61,9 +62,6 @@ dev.steenbakker.mobile_scanner.useUnbundled=true

### iOS

_iOS arm64 Simulators are currently not yet supported, until the migration to the Vision API is complete._
_See_ https://github.com/juliansteenbakker/mobile_scanner/issues/1225

**Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:**
NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor.

4 changes: 3 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ include: package:lint/analysis_options_package.yaml
linter:
rules:
- combinators_ordering
- comment_references
- require_trailing_commas
- unnecessary_library_directive
- prefer_single_quotes
- prefer_single_quotes
- public_member_api_docs
16 changes: 8 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -2,14 +2,14 @@ group 'dev.steenbakker.mobile_scanner'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.22'
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.3.2'
classpath 'com.android.tools.build:gradle:8.8.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@@ -29,7 +29,7 @@ android {
namespace 'dev.steenbakker.mobile_scanner'
}

compileSdk 34
compileSdk 35

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
@@ -70,17 +70,17 @@ dependencies {
implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.1'
} else {
// Bundled model in app
implementation 'com.google.mlkit:barcode-scanning:17.2.0'
implementation 'com.google.mlkit:barcode-scanning:17.3.0'
}

// org.jetbrains.kotlin:kotlin-bom artifact purpose is to align kotlin stdlib and related code versions.
// See: https://youtrack.jetbrains.com/issue/KT-55297/kotlin-stdlib-should-declare-constraints-on-kotlin-stdlib-jdk8-and-kotlin-stdlib-jdk7
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.22"))

implementation 'androidx.camera:camera-lifecycle:1.3.4'
implementation 'androidx.camera:camera-camera2:1.3.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation 'androidx.camera:camera-camera2:1.4.1'
implementation 'androidx.camera:camera-lifecycle:1.4.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.1'

testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'org.mockito:mockito-core:5.12.0'
testImplementation 'org.mockito:mockito-core:5.15.2'
}
7 changes: 7 additions & 0 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading