mobile_scanner
A universal Flutter barcode and QR code scanner using CameraX/ML Kit for Android, AVFoundation/Apple Vision for iOS & macOS, and ZXing for web.
7.4.0
1000K downloads/mo
#39 most downloaded on pub.dev
juliansteenbakker/mobile_scanner
What this package is like to depend on
Last release 1 months ago
20 Jul 2026
Release timing varies
gaps range from 9 days to 5 months
Nearly every release is documented
notes for 58 of 60 stable releases
3 versions withdrawn
withdrawn after publishing
5 years old
84 releases · first in 2022
10 releases in the last 12 months
see the full history below
Release timeline
84 releases · Feb 2022 to Jul 2026Releases
latest 60 of 84-
7.4.020 Jul 2026Release notes
Open source →7.4.0 (2026-07-19)
New features
- Added
getBestCloseRangeScanningLens()to determine which camera lens is best suited for scanning barcodes at close range (e.g. the ultra-wide/macro lens on newer iPhones). Returnsnullif no camera is available for the requested facing direction.
Improvements
- Added an optional
facingfilter togetSupportedLenses, to restrict results to front or back cameras.
Bug Fixes
- [Android] Fixed
getSupportedLensesreporting physical sub-cameras that CameraX can't actually select, which caused a crash when switching to one. - [Android] Starting the scanner with an unavailable
lensTypenow reports an error instead of silently falling back to the default camera.
Release notes
Open source →New features
- Added
getBestCloseRangeScanningLens()to determine which camera lens is best suited for scanning barcodes at close range (e.g. the ultra-wide/macro lens on newer iPhones). Returnsnullif no camera is available for the requested facing direction.
Improvements
- Added an optional
facingfilter togetSupportedLenses, to restrict results to front or back cameras.
Bug Fixes
- [Android] Fixed
getSupportedLensesreporting physical sub-cameras that CameraX can't actually select, which caused a crash when switching to one. - [Android] Starting the scanner with an unavailable
lensTypenow reports an error instead of silently falling back to the default camera.
- Added
-
7.3.016 Jul 2026Release notes
Open source →New features
- [Web] Added support for multiple barcode detection backends, selectable via
MobileScannerPlatform.instance.setWebBarcodeReader(WebBarcodeReader reader):WebBarcodeReader.auto(default), uses the nativeBarcodeDetectorAPI when available, and falls back tozxing-wasmotherwise.WebBarcodeReader.barcodeDetector, uses the W3C Shape Detection API (Chrome 83+, Edge 83+, Safari 17+). No external library is loaded.WebBarcodeReader.zxingWasm, uses zxing-wasm (ZXing C++ compiled to WebAssembly), which works in all modern browsers including Firefox.WebBarcodeReader.zxingJs, the legacy ZXing JavaScript backend, retained for backward compatibility.
- [Web] Added
MobileScannerPlatform.instance.activeWebReaderto query which backend is currently active. - Added
BarcodeFormat.maxiCodeandBarcodeFormat.microQrCode, supported by theWebBarcodeReader.zxingJsandWebBarcodeReader.zxingWasmbackends. - Added
BarcodeFormat.dataBar,BarcodeFormat.dataBarExpandedandBarcodeFormat.dataBarLimited(GS1 DataBar / RSS-14), supported by theWebBarcodeReader.zxingJsandWebBarcodeReader.zxingWasmbackends (DataBar and DataBar Expanded only forzxingJs), and by Apple Vision on iOS 15+ / macOS 12+.
Improvements
- [Web] Bumped
@zxing/library(theWebBarcodeReader.zxingJsbackend) from 0.21.3 to 0.23.0.
Bug Fixes
- Fixed disposing a
MobileScannerControlleralso disposing the platform resources of a different controller. Disposing a controller that does not hold the active camera session no longer tears down the camera of the controller that does. (#1631) - Fixed a subscription leak where a controller that was disposed without being stopped kept its internal event stream subscriptions alive.
- Fixed an issue when running the plugin using AGP 9.
Release notes
Open source →New features
- [Web] Added support for multiple barcode detection backends, selectable via
MobileScannerPlatform.instance.setWebBarcodeReader(WebBarcodeReader reader):WebBarcodeReader.auto(default), uses the nativeBarcodeDetectorAPI when available, and falls back tozxing-wasmotherwise.WebBarcodeReader.barcodeDetector, uses the W3C Shape Detection API (Chrome 83+, Edge 83+, Safari 17+). No external library is loaded.WebBarcodeReader.zxingWasm, uses zxing-wasm (ZXing C++ compiled to WebAssembly), which works in all modern browsers including Firefox.WebBarcodeReader.zxingJs, the legacy ZXing JavaScript backend, retained for backward compatibility.
- [Web] Added
MobileScannerPlatform.instance.activeWebReaderto query which backend is currently active. - Added
BarcodeFormat.maxiCodeandBarcodeFormat.microQrCode, supported by theWebBarcodeReader.zxingJsandWebBarcodeReader.zxingWasmbackends. - Added
BarcodeFormat.dataBar,BarcodeFormat.dataBarExpandedandBarcodeFormat.dataBarLimited(GS1 DataBar / RSS-14), supported by theWebBarcodeReader.zxingJsandWebBarcodeReader.zxingWasmbackends (DataBar and DataBar Expanded only forzxingJs), and by Apple Vision on iOS 15+ / macOS 12+.
Improvements
- [Web] Bumped
@zxing/library(theWebBarcodeReader.zxingJsbackend) from 0.21.3 to 0.23.0.
Bug Fixes
- Fixed disposing a
MobileScannerControlleralso disposing the platform resources of a different controller. Disposing a controller that does not hold the active camera session no longer tears down the camera of the controller that does. (#1631) - Fixed a subscription leak where a controller that was disposed without being stopped kept its internal event stream subscriptions alive.
- Fixed an issue when running the plugin using AGP 9.
- [Web] Added support for multiple barcode detection backends, selectable via
-
7.2.114 Jul 2026Release notes
Open source →Improvements
- [Web] The preferred camera device ID is now persisted in localStorage and reused on the next start.
- [Web] Focus, exposure, and white-balance constraints are now applied automatically when supported by the browser (Image Capture API).
- [Web] The camera now uses
StartOptions.cameraResolutionas the ideal resolution, falling back to 1920×1080. - [Web] The barcode overlay is now mirrored when the video preview is mirrored (e.g. front camera).
- [Web] The scan window is now supported. Barcodes detected outside the scan window are ignored.
- [Android] Laid groundwork for Android Gradle Plugin (AGP) 9 compatibility by conditionally applying the
kotlin-androidplugin only on AGP versions below 9, while remaining compatible with older AGP versions.
Bug Fixes
- [Apple] Fixed a race condition in
captureOutputwherelatestBufferwas read on a background thread after being deallocated on the main thread, causing a crash inVTCreateCGImageFromCVPixelBuffer. - [Apple] Fixed an issue where
captureOutputwas being processed on the main thread, causing overheating issues on device. - [Android] Fixed
start()not resuming the camera afterpause(), caused by theisPausedflag being reset before the paused-state check. - [Android] Fixed ProGuard/R8 full mode (default since AGP 8.0) stripping or obfuscating MLKit classes by widening the keep rule to
com.google.mlkit.**.
Release notes
Open source →Improvements
- [Web] The preferred camera device ID is now persisted in localStorage and reused on the next start.
- [Web] Focus, exposure, and white-balance constraints are now applied automatically when supported by the browser (Image Capture API).
- [Web] The camera now uses
StartOptions.cameraResolutionas the ideal resolution, falling back to 1920×1080. - [Web] The barcode overlay is now mirrored when the video preview is mirrored (e.g. front camera).
- [Web] The scan window is now supported. Barcodes detected outside the scan window are ignored.
- [Android] Laid groundwork for Android Gradle Plugin (AGP) 9 compatibility by conditionally applying the
kotlin-androidplugin only on AGP versions below 9, while remaining compatible with older AGP versions.
Bug Fixes
- [Apple] Fixed a race condition in
captureOutputwherelatestBufferwas read on a background thread after being deallocated on the main thread, causing a crash inVTCreateCGImageFromCVPixelBuffer. - [Apple] Fixed an issue where
captureOutputwas being processed on the main thread, causing overheating issues on device. - [Android] Fixed
start()not resuming the camera afterpause(), caused by theisPausedflag being reset before the paused-state check. - [Android] Fixed ProGuard/R8 full mode (default since AGP 8.0) stripping or obfuscating MLKit classes by widening the keep rule to
com.google.mlkit.**.
-
7.2.018 Feb 2026Release notes
Open source →Highlights
- Added support for switching between lens types (normal, wide, zoom) using the
switchCamera()method withToggleLensTypeorSelectCameraoptions. - Added
rawDecodedBytesfield toBarcodewhich replacesBarcode.rawBytes. On Apple platforms, this returns aDecodedVisionBarcodeBytescontainingbytes(decoded payload, without header/padding) andrawBytes(full raw payload, available on iOS 17.0+ / macOS 14.0+). On Android and web, this returns aDecodedBarcodeBytescontainingbytes.
Improvements
- [Android] Migrated barcode bounding box from
boundingBoxtocornerPointsfor more accurate scan window detection. - Added support for
ITF-Two-of-Five. - Added constants for testing the method channel methods in
MobileScannerMethodsandMobileScannerEvents. - The global method
calculateBoxFitRatio()is now deprecated.
Bug Fixes
- [Android] Fixed incorrect texture size on orientation change.
- [Android] Fixed a bug where the
isPausedflag was not reset whenstart()was called. - [Android] Fixed
imageAnalysisnot being unbound on dispose. - [Android] Fixed an issue where the app orientation handling was not respecting auto-rotate settings
- [Apple] Fixed
rawBytesreturning incorrect data for barcodes containing non-ASCII characters (e.g.ø). For QR codes, bytes are now extracted directly from the error-corrected bit stream viaCIQRCodeDescriptor, bypassing the Vision string API entirely. For Aztec, DataMatrix, PDF417 and linear formats, the ISO-Latin-1 round-trip is used to recover the original bytes frompayloadStringValue. - [Apple] Fixed
displayValuereturning a garbled Latin-1 string (e.g.hellø) for barcodes with non-ASCII UTF-8 content. It is now correctly decoded to UTF-8 (e.g.hellø). - [Apple] Fixed a bug where the barcode type results did not have a value.
- [Apple] Fixed camera rotating, even when rotation is locked.
- [macOS] Fixed barcode overlay text displaying upside down.
- Fixed barcode overlay rendering at wrong position after orientation change.
- Fixed a bug where taps were ignored on the scanner widget.
- Fixed a bug where a controller that was only disposed would throw an incorrect error code.
Release notes
Open source →Highlights
- Added support for switching between lens types (normal, wide, zoom) using the
switchCamera()method withToggleLensTypeorSelectCameraoptions. - Added
rawDecodedBytesfield toBarcodewhich replacesBarcode.rawBytes. On Apple platforms, this returns aDecodedVisionBarcodeBytescontainingbytes(decoded payload, without header/padding) andrawBytes(full raw payload, available on iOS 17.0+ / macOS 14.0+). On Android and web, this returns aDecodedBarcodeBytescontainingbytes.
Improvements
- [Android] Migrated barcode bounding box from
boundingBoxtocornerPointsfor more accurate scan window detection. - Added support for
ITF-Two-of-Five. - Added constants for testing the method channel methods in
MobileScannerMethodsandMobileScannerEvents. - The global method
calculateBoxFitRatio()is now deprecated.
Bug Fixes
- [Android] Fixed incorrect texture size on orientation change.
- [Android] Fixed a bug where the
isPausedflag was not reset whenstart()was called. - [Android] Fixed
imageAnalysisnot being unbound on dispose. - [Android] Fixed an issue where the app orientation handling was not respecting auto-rotate settings
- [Apple] Fixed
rawBytesreturning incorrect data for barcodes containing non-ASCII characters (e.g.ø). For QR codes, bytes are now extracted directly from the error-corrected bit stream viaCIQRCodeDescriptor, bypassing the Vision string API entirely. For Aztec, DataMatrix, PDF417 and linear formats, the ISO-Latin-1 round-trip is used to recover the original bytes frompayloadStringValue. - [Apple] Fixed
displayValuereturning a garbled Latin-1 string (e.g.hellø) for barcodes with non-ASCII UTF-8 content. It is now correctly decoded to UTF-8 (e.g.hellø). - [Apple] Fixed a bug where the barcode type results did not have a value.
- [Apple] Fixed camera rotating, even when rotation is locked.
- [macOS] Fixed barcode overlay text displaying upside down.
- Fixed barcode overlay rendering at wrong position after orientation change.
- Fixed a bug where taps were ignored on the scanner widget.
- Fixed a bug where a controller that was only disposed would throw an incorrect error code.
7.1.4
- [Apple] Fixed crash on iPhone 17 when starting MobileScanner by checking available pixel formats before setting video output settings. (#1578)
7.1.3
-
Overlay: Updated
BarcodePainterto receivedeviceOrientationand dynamically adjustcameraPreviewSize, fixing barcode overlay misalignment during device rotation changes . -
[Android] Refactored orientation detection to use
OrientationEventListenerinstead ofBroadcastReceiverforACTION_CONFIGURATION_CHANGED, ensuring physical device orientation is captured correctly and preventing unwanted screen rotations onMobileScannerinitialization . -
[Android] Changed minSDK from 21 to 23 in line with Flutter requirements.
-
[Android] Removed deprecated renderscript api's, improved performance for analysis.
-
[Apple] Prevent half-stopped camera state causing false ALREADY_STARTED.
-
[Apple] Fixed a bug where invalid images would cause crashes when processing them with CoreVideo.
- Added support for switching between lens types (normal, wide, zoom) using the
-
7.1.412 Dec 2025Nothing published for this version
-
7.1.324 Oct 2025Release notes
Open source →-
Overlay: Updated
BarcodePainterto receivedeviceOrientationand dynamically adjustcameraPreviewSize, fixing barcode overlay misalignment during device rotation changes . -
[Android] Refactored orientation detection to use
OrientationEventListenerinstead ofBroadcastReceiverforACTION_CONFIGURATION_CHANGED, ensuring physical device orientation is captured correctly and preventing unwanted screen rotations onMobileScannerinitialization . -
[Android] Changed minSDK from 21 to 23 in line with Flutter requirements.
-
[Android] Removed deprecated renderscript api's, improved performance for analysis.
-
[Apple] Prevent half-stopped camera state causing false ALREADY_STARTED.
-
[Apple] Fixed a bug where invalid images would cause crashes when processing them with CoreVideo.
-
-
7.1.223 Sep 2025 -
7.1.123 Sep 2025 -
7.1.023 Sep 2025Release notes
Open source →Highlights
- [Apple & Android] Added tap to focus functionality. You can enable it in the
MobileScannerwidget. - [Apple & Android] You can now set the initial zoom factor using the
initialZoomparameter in thestartOptions.
Bug Fixes and Improvements
- [iOS] Increased minimum os level to 13 due to Flutter requirements.
- [macOS] Increased minimum os level to 10.15 due to Flutter requirements.
- [Android] Update to Java 17, and update other dependencies.
- [Apple] Improved fallback for when camera is not found.
- Added a
Barcode.scaleCorners()method.
Release notes
Open source →Highlights
- [Apple & Android] Added tap to focus functionality. You can enable it in the
MobileScannerwidget. - [Apple & Android] You can now set the initial zoom factor using the
initialZoomparameter in thestartOptions.
Bug Fixes and Improvements
- [iOS] Increased minimum os level to 13 due to Flutter requirements.
- [macOS] Increased minimum os level to 10.15 due to Flutter requirements.
- [Android] Update to Java 17, and update other dependencies.
- [Apple] Improved fallback for when camera is not found.
- Added a
Barcode.scaleCorners()method.
- [Apple & Android] Added tap to focus functionality. You can enable it in the
-
7.0.104 Jun 2025Release notes
Open source →- Added error handling for when
MobileScannerController.startis called without an activeMobileScannerwidget.
- Added error handling for when
-
7.0.002 May 2025Release notes
Open source →This version finalizes all changes from the beta and release candidate cycles and introduces major improvements, bug fixes, and breaking changes.
BREAKING CHANGES
- Requires Flutter 3.29.0 or higher.
- The initial camera facing direction in
MobileScannerStateis nowCameraFacing.unknown. - Removed the deprecated
EncryptionType.none. UseEncryptionType.unknowninstead. - The
errorBuilderandplaceholderBuilderno longer have a Widget argument. - Removed the
MobileScannerErrorBuildertypedef.
Highlights
- [iOS/macOS] Migrated to the Vision API with a unified Apple codebase.
- [iOS] Minimum iOS version changed from 15 to 12.
- [Android] Removed dependency on
kotlin-bomand updated CameraX and camera-camera2 dependencies. - Support for pause/resume functionality across platforms.
MobileScannerErrorCodenow includes readable error messages in debug mode.- Hot-restart during development now works correctly.
- Added overlay widgets for barcode and scan window visualization.
- Exposed new API parameters like
autoZoom,invertImage, and lifecycle handling.
Bug Fixes and Improvements
- [Apple]
- Fixed rotation, orientation, and zoom behavior.
- Resolved incorrect barcode overlay dimensions and corner coordinates.
- Fixed a crash when stopping the camera with a nil device.
- Fixed build issues including optional chaining on non-optional values.
- [Android]
- Fixed rotation and orientation issues.
- Resolved timing issues in
SurfaceProducerwith Kotlin 1.8+. - Fixed resource leaks and improved image analysis compatibility.
- Improved logging behavior (CameraX logs only errors).
- [macOS]
- Fixed mirrored images and build issues.
- [Web]
- Fixed barcode overlay not displaying due to incorrect corner point data.
-
7.0.0-rc.224 Apr 2025 pre-releaseRelease notes
Open source →Bugs fixed:
- [Apple] Fixed build issues "Cannot use optional chaining on non-optional value".
-
7.0.0-rc.123 Apr 2025 pre-releaseRelease notes
Open source →After six months of development, Version 7.0.0 is finally moving out of beta with this release candidate! A stable release is scheduled for next week.
Improvements:
- [Android] Remove the dependency on
org.jetbrains.kotlin:kotlin-bom. - [Android] Updated camerax dependencies.
- Hot-restart for development purposes is now working correctly
- Added message to
MobileScannerErrorCode, which will be shown if kDebugMode is true. Otherwise, a generic error message will appear. - Fixed issues regarding initialization of the
MobileScannerController, which could result in a black screen without error message.
Bugs fixed:
- [Android] Fixed rotation & orientation issues.
- [Apple] Fixed rotation & orientation issues.
- [Apple] Fixed a crash when stopping the camera when the camera device is nil.
- [macOS] Fixed image not being mirrored.
- [Web] Fixed barcode corners not being passed correctly resulting in no overlay being drawn.
- [Android] Remove the dependency on
-
7.0.0-beta.909 Apr 2025 pre-releaseRelease notes
Open source →BREAKING CHANGES:
- This release requires Flutter 3.29.0 or higher.
Bugs fixed:
- [Android] Fixed a timing issue for the SurfaceProducer implementation, by switching to the
onSurfaceCleanupcallback.
-
7.0.0-beta.805 Mar 2025 pre-releaseRelease notes
Open source →Improvements:
- Updated examples in example app.
- Added [useAppLifecycleState] parameter to enable or disable handling of lifecycle state when no controller is passed.
- Dispose function of [MobileScanner] is now async.
- The [BarcodeOverlay] now correctly disposes the text painter.
Bugs fixed:
- [Apple] Fixed barcode corners representation for barcode overlay.
- [Apple] Fixed zoom callback not working.
- [Apple] Updated zoom scale factor to match Android implementation.
- Fixed build issues on older kotlin versions.
-
7.0.0-beta.721 Feb 2025 pre-releaseRelease notes
Open source →BREAKING CHANGES:
- The initial state of the
MobileScannerStatecamera facing direction is changed toCameraFacing.unknown.
Improvements:
- [Android] Turn off logging for CameraX, except for the
Log.ERRORlogging level. - Added
CameraFacing.externalandCameraFacing.unknownenum values.
Bugs fixed:
- [Android] Fixed an issue when compiling with Kotlin 1.8.0 or higher.
- The initial state of the
-
7.0.0-beta.604 Feb 2025 pre-releaseRelease notes
Open source →BREAKING CHANGES:
- This release requires Flutter 3.27.0 or higher.
Improvements:
- [Android] Added support for Impeller.
- [Apple] Added support for
rawBytesfrom the Vision API observations. - Export the
MobileScannerViewAttributesandStartOptionstypes, 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.527 Jan 2025 pre-releaseRelease notes
Open source →Improvements:
- [Android] Added
autoZoomparameter to auto zoom if the detected code is to far from the camera. - [Android] Added
invertImageparameter 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.
- [Android] Added
-
7.0.0-beta.407 Jan 2025 pre-releaseRelease notes
Open source →BREAKING CHANGES:
- The
updateScanWindowmethod is now private. Instead, update the scan window in theMobileScannerwidget directly. - The deprecated
EncryptionType.noneconstant has been removed. UseEncryptionType.unknowninstead. - The
errorBuilderandplaceholderBuilderof theMobileScannerwidget no longer take a Widget argument, as it was unused. - The
MobileScannerErrorBuildertypedef 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
analyzeImagewould not throw an error if no valid image is provided as argument. - [Apple] Fixed an issue where
analyzeImagewould 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
analyzeImagewould 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
colorandstyleproperties to theBarcodePainterwidget. - Enabled Swift Package Manager for the example app.
- The
-
7.0.0-beta.329 Oct 2024 pre-release -
7.0.0-beta.228 Oct 2024 pre-releaseRelease notes
Open source →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.123 Oct 2024 pre-releaseRelease notes
Open source →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.1122 Sep 2025 -
6.0.1021 Apr 2025Release notes
Open source →- [Apple] Fixed a crash when stopping the camera when the camera device is nil.
-
6.0.921 Apr 2025 -
6.0.818 Apr 2025 withdrawnRelease notes
Open source →Improvements:
- [Android] Remove the dependency on
org.jetbrains.kotlin:kotlin-bom. - Hot-restart for development purposes is now working correctly
- Added message to
MobileScannerErrorCode, which will be shown if kDebugMode is true. Otherwise, a generic error message will appear. - Fixed issues regarding initialization of the
MobileScannerController, which could result in a black screen without error message.
- [Android] Remove the dependency on
-
6.0.705 Mar 2025Release notes
Open source →Improvements:
- [Android] Updated bundled barcode scanning library to v17.3.0
-
6.0.604 Feb 2025Release notes
Open source →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.528 Jan 2025Release notes
Open source →Bugs fixed:
- [Android] Fixed crash due to imageProxy being closed too early.
-
6.0.427 Jan 2025 withdrawn -
6.0.316 Jan 2025Release notes
Open source →New features:
- Adds pause function to pause the camera but keep textures in place.
-
6.0.223 Oct 2024Release notes
Open source →Bugs fixed:
- Fixed a bug that prevented
analyzeImagefrom actually accepting the configured formats.
Improvements:
- [iOS] Excluded the
arm64architecture for Simulators, which is unsupported by MLKit 7.0.0.
- Fixed a bug that prevented
-
6.0.111 Oct 2024Release notes
Open source →Bugs fixed:
- Fixed a bug that would cause onDetect to not handle errors.
Improvements:
- [iOS] Excluded the
armv7architecture, which is unsupported by MLKit 7.0.0. - Added a new
onDetectErrorerror handler to theMobileScannerwidget, for use withonDetect.
-
6.0.008 Oct 2024Release notes
Open source →BREAKING CHANGES:
- [iOS] iOS 15.5.0 is now the minimum supported iOS version.
- [iOS] Updates MLKit to version 7.0.0.
- [iOS] Updates the minimum supported XCode version to 15.3.0.
Improvements:
- [MacOS] Added the corners and size information to barcode results.
- [MacOS] Added support for
analyzeImage. - [MacOS] Added a Privacy Manifest.
- [web] Added the size information to barcode results.
- [web] Added the video output size information to barcode capture.
- Added support for barcode formats to image analysis.
- Updated the scanner to report any scanning errors that were encountered during processing.
- Introduced a new getter
hasCameraPermissionfor theMobileScannerState. - Fixed a bug in the lifecycle handling sample. Now instead of checking
isInitialized, the sample recommends usinghasCameraPermission, which also guards against camera permission errors. - Updated the behavior of
returnImageto only determine if the camera output bytes should be sent. - Updated the behavior of
BarcodeCapture.sizeto always be provided when available, regardless ofreturnImage.
Bugs fixed:
- Fixed a bug that would cause the scanner to emit an error when it was already started. Now it ignores any calls to start while it is starting.
- [MacOS] Fixed a bug that prevented the
anaylzeImage()sample from working properly.
-
5.2.309 Sep 2024Release notes
Open source →Deprecations:
- The
EncryptionType.noneconstant has been deprecated, as its name was misleading. UseEncryptionType.unknowninstead.
Bugs fixed:
- Fixed
EncryptionTypethrowing on invalidSAEencryption type. - [web] Removed the
controlsattribute on the video preview.
Improvements:
- All enum types for barcode data (i.e. Wifi type or email type) now return
unknownfor unrecognized values.
- The
-
5.2.205 Sep 2024Release notes
Open source →Improvements:
- [MacOS] Adds Swift Package Manager support.
- [MacOS] Adds support for
returnImage. - Added a new
sizeproperty toBarcode, that denotes the bounding box of the barcode.
Bugs fixed:
- Fixed some documentation errors for the
sizeandimageofBarcodeCapture. - [iOS] Fixed a bug with
returnImage. - [Android/iOS] Adjusted the raw barcode scan value to pass the raw event data, like on MacOS.
-
5.2.120 Aug 2024 -
5.2.020 Aug 2024Release notes
Open source →This release requires Flutter 3.22.0 and Dart 3.4.
- [Android] Fixed a leak of the barcode scanner.
- [Android] Fixed a crash when encountering invalid numbers for the scan window.
- [Web] Migrates
package:webto 1.0.0.
-
5.1.115 May 2024 -
5.1.003 May 2024Release notes
Open source →This updates reverts a few breaking changes made in v5.0.0 in order to keep things simple.
- The
onDetectmethod has been reinstated in theMobileScannerwidget, but is nullable. You can still listen toMobileScannerController.barcodesdirectly by passing null to this parameter. - The
autoStartattribute has been reinstated in theMobileScannerControllerand defaults to true. However, if you want to control which camera is used on start, or you want to manage the lifecycle yourself, you should set autoStart to false and manually callMobileScannerController.start({CameraFacing? cameraDirection}). - The
controlleris no longer required in theMobileScannerwidget. However if provided, the user should take care of disposing it. - [Android] Revert Gradle 8 back to Gradle 7, to be inline with most Flutter plugins and prevent build issues.
- [Android] Revert Kotlin back from 1.9 to 1.7 to be inline with most Flutter plugins. Special 1.9 functionality has been refactored to be compatible with 1.7.
- The
-
5.0.230 Apr 2024Release notes
Open source →Bugs fixed:
- Fixed a crash when the controller is disposed while it is still starting. #1036 (thanks @EArminjon !)
- Fixed an issue that causes the initial torch state to be out of sync.
Improvements:
- Updated the lifeycle code sample to handle not-initialized controllers.
-
5.0.123 Apr 2024Release notes
Open source →Improvements:
- Adjusted the platform checks to use the defaultTargetPlatform API, so that tests can use the correct platform overrides.
-
5.0.022 Apr 2024Release notes
Open source →This major release contains all the changes from the 5.0.0 beta releases, along with the following changes:
Improvements:
- [Android] Remove the Kotlin Standard Library from the dependencies, as it is automatically included in Kotlin 1.4+
-
5.0.0-beta.316 Apr 2024 pre-releaseRelease notes
Open source →BREAKING CHANGES:
- Flutter 3.19.0 is now required.
- [iOS] iOS 12.0 is now the minimum supported iOS version.
- [iOS] Adds a Privacy Manifest.
Bugs fixed:
- Fixed an issue where the camera preview and barcode scanner did not work the second time on web.
Improvements:
- [web] Migrates to extension types. (thanks @koji-1009 !)
-
5.0.0-beta.221 Mar 2024 pre-releaseRelease notes
Open source →Bugs fixed:
- Fixed an issue where the scan window was not updated when its size was changed. (thanks @navaronbracke !)
-
5.0.0-beta.128 Feb 2024 pre-releaseRelease notes
Open source →BREAKING CHANGES:
- The
widthandheightofBarcodeCapturehave been removed, in favor ofsize. - The
rawattribute is nowObject?instead ofdynamic, so that it participates in type promotion. - The
MobileScannerArgumentsclass has been removed from the public API, as it is an internal type. - The
cameraFacingOverridenamed argument for thestart()method has been renamed tocameraDirection. - The
analyzeImagefunction now correctly returns aBarcodeCapture?instead of a boolean. - The
formatsattribute of theMobileScannerControlleris now non-null. - The
MobileScannerStateenum has been renamed toMobileScannerAuthorizationState. - The various
ValueNotifiers for the camera state have been removed. Use thevalueof theMobileScannerControllerinstead. - The
hasTorchgetter has been removed. Instead, use the torch state of the controller's value. TheTorchStateenum now provides a new value for unavailable flashlights. - The
autoStartattribute has been removed from theMobileScannerController. The controller should be manually started on-demand. - A controller is now required for the
MobileScannerwidget. - The
onPermissionSet,onStartandonScannerStartedmethods have been removed from theMobileScannerwidget. Instead, awaitMobileScannerController.start(). - The
startDelayhas been removed from theMobileScannerwidget. Instead, use a delay between manual starts of one or more controllers. - The
onDetectmethod has been removed from theMobileScannerwidget. Instead, listen toMobileScannerController.barcodesdirectly. - The
overlaywidget of theMobileScannerhas been replaced by a new property,overlayBuilder, which provides the constraints for the overlay. - The torch can no longer be toggled on the web, as this is only available for image tracks and not video tracks. As a result the torch state for the web will always be
TorchState.unavailable. - The zoom scale can no longer be modified on the web, as this is only available for image tracks and not video tracks. As a result, the zoom scale will always be
1.0.
Improvements:
- The
MobileScannerControlleris now a ChangeNotifier, withMobileScannerStateas its model. - The web implementation now supports alternate URLs for loading the barcode library.
- The
-
4.0.128 Feb 2024Release notes
Open source →Bugs fixed:
- [iOS] Fixed a crash with a nil capture session when starting the camera. (thanks @navaronbracke !)
-
4.0.029 Jan 2024Release notes
Open source →BREAKING CHANGES:
- [Android] compileSdk has been upgraded to version 34.
- [Android] Java version has been upgraded to version 17.
-
3.5.729 Jan 2024Release notes
Open source →Improvements:
- Updated js dependency together with other dependencies.
- Reverted compileSdk version to 33 on Android. This update will be released under version 4.0.0.
-
3.5.608 Jan 2024Release notes
Open source →Bugs fixed:
- [web] Fixed a crash with the ZXing barcode format (thanks @hazzo!)
- [web] Fixed stream controller not being closed on web.
- [iOS] Fixed a crash with unsupported torch modes. (thanks @navaronbracke !)
- [iOS] Fixed a crash with the camera discovery session. (thanks @navaronbracke !)
Improvements:
- Upgrade camera dependencies on Android.
- Upgrade compileSdk version to 34 on Android.
- Add numberOfCameras parameter in MobileScannerArguments callback, which shows how many cameras there are available on Android.
- [Android] Migrated to ResolutionSelector with ResolutionStrategy. You can opt in into the new selector by setting [useNewCameraSelector] in the [MobileScannerController] to true.
-
3.5.527 Nov 2023Release notes
Open source →Bugs fixed:
- Fixed a bug where the scanner would get stuck after denying permissions on Android. (thanks @navaronbracke !)
-
3.5.422 Nov 2023Release notes
Open source →Bugs fixed:
- Fixed a bug with an implicit conversion to integer for the scan timeout for iOS. (thanks @EArminjon !)
-
3.5.322 Nov 2023 withdrawnNothing published for this version
-
3.5.231 Oct 2023Release notes
Open source →Improvements:
- Updated to
play-services-mlkit-barcode-scanningversion 18.3.0
Bugs fixed:
- Fixed the
updateScanWindow()function not completing on Android and MacOS. (thanks @navaronbracke !) - Fixed some camera access issues, when the camera could have been null on Android. (thanks @navaronbracke !)
- Fixed a crash on Android when there is no camera. (thanks @navaronbracke !)
- Fixed a bug with the
noDuplicatesdetection speed. (thanks @pgeof !) - Fixed a synchronization issue for the torch state. (thanks @navaronbracke !)
- Updated to
-
3.5.124 Oct 2023Release notes
Open source →Improvements:
- The
typeof anAddressis now non-null. - The
typeof anEmailis now non-null. - The
phoneNumberof anSMSis now non-null. - The
latitudeandlongitudeof aGeoPointare now non-null. - The
phonesandurlsofContactInfoare now non-null. - The
urlof aUrlBookmarkis now non-null. - The
typeofPhoneis now non-null. - The
widthandheightofBarcodeCaptureare now non-null. - The
BarcodeCaptureclass now exposes asize. - The list of
cornersof aBarcodeis now non-null.
Bugs fixed:
- Fixed the default values for the
formatandtypearguments of the Barcode constructor. These now useBarcodeFormat.unknownandBarcodeType.unknown, rather thanBarcodeFormat.ean13andBarcodeType.text. (thanks @navaronbracke !) - Fixed messages not being sent on the main thread for Android, iOS and MacOS. (thanks @navaronbracke !)
- The
-
3.5.022 Oct 2023Release notes
Open source →NOTE: From this version onwards,
mobile_scannerrequires Android projects to have acompileSdkof 34 (Android 14) or higherNew Features:
- Added the option to switch between bundled and unbundled MLKit for Android. (thanks @woolfred !)
- Added the option to specify the camera resolution for Android. (thanks @EArminjon !)
- Added a sample with a scanner overlay. (thanks @Spyy004 !)
Bugs fixed:
- Fixed the scan window calculation taking into account the widget coordinates, instead of the screen coordinates. (thanks @jlin5 !)
- Fixed the scan window calculation returning wrong results. (thanks @MBulli !)
- Fixed the BarcodeCapture format on MacOS. (thanks @ryanduffyne !)
- Fixed the timeout for scanning on MacOS. (thanks @ryanduffyne !)
- Fixed Android builds failing by downgrading from Kotlin 1.9.10 to 1.7.22. (thanks @vbuberen !)
- Fixed images on iOS being rotated, resulting in bad detection rates. (thanks @EArminjon !)
- Fixed scan timeout not working on iOS. (thanks @navaronbracke !)
- Fixed a crash on iOS when the device is nil. (thanks @navaronbracke !)
- Fixed a case of an unhandled exception when starting the scanner. (thanks @navaronbracke !)
Improvements:
- Improved MacOS memory footprint by using a background queue. (thanks @ryanduffyne !)
-
3.4.107 Aug 2023Release notes
Open source →- Changed MediaQuery.sizeOf(context) to of(context).size for compatibility with older Flutter versions.
-
3.4.007 Aug 2023Release notes
Open source →New Features:
- This PR adds an option to add an overlay to the scanner which is only visible when the scanner has started. (thanks @svenopdehipt !)
Improvements:
-
fix a bug in the static interop binding of PhotoCapabilities (thanks @navaronbracke !)
-
[Web] add the corners from the ZXing result to the barcode on web (thanks @navaronbracke !)
-
update the example app web entrypoint to the latest template by running flutter create . --platforms=web (thanks @navaronbracke !)
-
add better handling for the case where scanning barcodes is unsupported (for example a desktop running the browser sample) (thanks @navaronbracke !)
-
[Web] fix the permission denied handling on the web, by using the NotAllowedError error message as defined by MDN (thanks @navaronbracke !)
-
add app bars with back buttons to the example app (so that you can go back easily) (thanks @navaronbracke !)
-
[iOS] Implements a fix from issue iOS After first QR Code Scan, When Scanning again, First Image stays on Camera buffer (thanks @FlockiiX !)
-
By dynamically adjusting the positioning and scaling of the scan window relative to the texture, the package ensures optimal coverage and alignment for scanning targets. (thanks @sdkysfzai !)
-
In the original package, If there are multiple barcode/qrcodes in the screen, the scan would randomly pick up any barcode/qrcode that shows in the screen, This upgrade fixes it and picks on the qrcode/barcode that is in the center of the camera. (thanks @sdkysfzai !)
-
In the original package if you changed the camera size, it would still pick scans even if the barcode are not shown in the screen, This issue is also fixed in the upgraded packaged. (thanks @sdkysfzai !)
-
[iOS] This removes a threading warning (and potentially jank). (thanks @ened !)
-
[Android] fix(ScanImage): fix android image result is not correct format and orientation (thanks @phanbaohuy96 !)
-
[iOS] Respect detectionTimeout on iOS devices, instead of arbitrarily waiting 10 frames (thanks @jorgenpt !)
-
[iOS] Don't start a second scan until the first one is done, to keep memory usage more fixed if the device is slow (thanks @jorgenpt !)
-
[Android] This PR ensure that the camera is not stopped in the callback. (thanks @g123k !)
-
[macOS] Fix some macOS build errors (thanks @svenopdehipt !)
-
[Android] Fixed an issue which caused the App Lifecycle States to not work correctly on Android. (thanks @androi7 !)
-
3.3.027 Jun 2023Release notes
Open source →Bugs fixed:
- Fixed bug where onDetect method was being called multiple times
- [Android] Fix Gradle 8 compatibility by adding the
namespaceattribute to the build.gradle.
Improvements:
- [Android] Upgraded camera2 dependency
- Added zoomScale value notifier in MobileScannerController for the application to know the zoom scale value set actually. The value is notified from the native SDK(CameraX/AVFoundation).
- Added resetZoomScale() in MobileScannerController to reset zoom ratio with 1x. Both Android and iOS, if the device have ultra-wide camera, calling setZoomScale with small value causes to use ultra-wide camera and may be diffcult to detect barcodes. resetZoomScale() is useful to use standard camera with zoom 1x. setZoomScale() with the specific value can realize same effect, but added resetZoomScale for avoiding floating point errors. The application can know what zoom scale value is selected actually by subscribing zoomScale above after calling resetZoomScale.
- [iOS] Call resetZoomScale while starting scan. Android camera is initialized with a zoom of 1x, whereas iOS is initialized with the minimum zoom value, which causes to select the ultra-wide camera unintentionally ([iOS] Impossible to focus and scan the QR code due to picking the wide back camera #554). Fixed this issue by calling resetZoomScale
- [iOS] Remove zoom animation with ramp function to match Android behavior.
-
3.2.029 Mar 2023Release notes
Open source →Improvements:
- [iOS] Updated GoogleMLKit/BarcodeScanning to 4.0.0
- [Android] Updated com.google.mlkit:barcode-scanning from 17.0.3 to 17.1.0
Bugs fixed:
- Fixed onDetect not working with analyzeImage when autoStart is false in MobileScannerController
- [iOS] Explicit returned type for compactMap