NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #293 most downloaded on pub.dev
A universal Flutter barcode and QR code scanner using CameraX/ML Kit for Android, AVFoundation/Apple Vision for iOS & macOS, and ZXing for web.
Last release 24 days ago
14 Sep 2026
Release timing varies
gaps range from 9 days to 5 months
Nearly every release is documented
notes for 58 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
5 years old
86 releases · first in 2022
android: defer orientation sensor listener until camera start
[Web] Bumped zxing-wasm (the WebBarcodeReader.zxingWasm backend) from 3.1.1 to 3.1.3.
Improvements
zxing-wasm (the WebBarcodeReader.zxingWasm backend) from 3.1.1 to 3.1.3.Bug Fixes
ImageProxy is now released on every exit path of the analyzer, including a null image, a failed or cancelled ML Kit request, and any error while building the input image or handling the result. Previously a single leaked frame stopped all further scanning while the preview kept running. (thanks @WladmirJunior !)errorBuilder instead of terminating the app.Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP): mobile_scanner warning on AGP 9. The plugin's Gradle files are now Kotlin DSL, and the Kotlin Gradle Plugin is only applied when built-in Kotlin is disabled, which keeps the build working on older AGP versions. (thanks @AndresMontaniv !)com.google.android.gms.internal.mlkit_vision_barcode), which could be stripped or obfuscated in release builds.EXC_BAD_ACCESS. The capture session is now stopped before the engine is destroyed, and the camera is released when the engine detaches the plugin.@JS annotations on extension type constructors. The annotations were already no-ops, so removing them does not change any behavior.switchCamera(). Restarting the camera recreated the device orientation stream, and cancelling a listener of the previous stream instance afterwards inadvertently tore down the platform channel of the new one.One column per quarter.
Added getBestCloseRangeScanningLens() to determine which camera lens is best suited for scanning barcodes at close range (e.g. the ultra-wide/macro le
New features
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). Returns null if no camera is available for the requested facing direction.Improvements
facing filter to getSupportedLenses, to restrict results to front or back cameras.Bug Fixes
getSupportedLenses reporting physical sub-cameras that CameraX can't actually select, which caused a crash when switching to one.lensType now reports an error instead of silently falling back to the default camera.[Web] Added support for multiple barcode detection backends, selectable via MobileScannerPlatform.instance.setWebBarcodeReader(WebBarcodeReader reader
New features
MobileScannerPlatform.instance.setWebBarcodeReader(WebBarcodeReader reader):
WebBarcodeReader.auto (default), uses the native BarcodeDetector API when available, and falls back to zxing-wasm otherwise.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.MobileScannerPlatform.instance.activeWebReader to query which backend is currently active.BarcodeFormat.maxiCode and BarcodeFormat.microQrCode, supported by the WebBarcodeReader.zxingJs and WebBarcodeReader.zxingWasm backends.BarcodeFormat.dataBar, BarcodeFormat.dataBarExpanded and BarcodeFormat.dataBarLimited (GS1 DataBar / RSS-14), supported by the WebBarcodeReader.zxingJs and WebBarcodeReader.zxingWasm backends (DataBar and DataBar Expanded only for zxingJs), and by Apple Vision on iOS 15+ / macOS 12+.Improvements
@zxing/library (the WebBarcodeReader.zxingJs backend) from 0.21.3 to 0.23.0.Bug Fixes
MobileScannerController also 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)[Web] The preferred camera device ID is now persisted in localStorage and reused on the next start.
Improvements
StartOptions.cameraResolution as the ideal resolution, falling back to 1920×1080.kotlin-android plugin only on AGP versions below 9, while remaining compatible with older AGP versions.Bug Fixes
captureOutput where latestBuffer was read on a background thread after being deallocated on the main thread, causing a crash in VTCreateCGImageFromCVPixelBuffer.captureOutput was being processed on the main thread, causing overheating issues on device.start() not resuming the camera after pause(), caused by the isPaused flag being reset before the paused-state check.com.google.mlkit.**.The global method calculateBoxFitRatio() is now deprecated.
Highlights
switchCamera() method with ToggleLensType or SelectCamera options.rawDecodedBytes field to Barcode which replaces Barcode.rawBytes. On Apple platforms, this returns a DecodedVisionBarcodeBytes containing bytes (decoded payload, without header/padding) and rawBytes (full raw payload, available on iOS 17.0+ / macOS 14.0+). On Android and web, this returns a DecodedBarcodeBytes containing bytes.Improvements
boundingBox to cornerPoints for more accurate scan window detection.ITF-Two-of-Five.MobileScannerMethods and MobileScannerEvents.calculateBoxFitRatio() is now deprecated.Bug Fixes
isPaused flag was not reset when start() was called.imageAnalysis not being unbound on dispose.rawBytes returning incorrect data for barcodes containing non-ASCII characters (e.g. ø). For QR codes, bytes are now extracted directly from the error-corrected bit stream via CIQRCodeDescriptor, 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 from payloadStringValue.displayValue returning 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ø).Highlights
switchCamera() method with ToggleLensType or SelectCamera options.rawDecodedBytes field to Barcode which replaces Barcode.rawBytes. On Apple platforms, this returns a DecodedVisionBarcodeBytes containing bytes (decoded payload, without header/padding) and rawBytes (full raw payload, available on iOS 17.0+ / macOS 14.0+). On Android and web, this returns a DecodedBarcodeBytes containing bytes.Improvements
boundingBox to cornerPoints for more accurate scan window detection.ITF-Two-of-Five.MobileScannerMethods and MobileScannerEvents.calculateBoxFitRatio() is now deprecated.Bug Fixes
isPaused flag was not reset when start() was called.imageAnalysis not being unbound on dispose.rawBytes returning incorrect data for barcodes containing non-ASCII characters (e.g. ø). For QR codes, bytes are now extracted directly from the error-corrected bit stream via CIQRCodeDescriptor, 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 from payloadStringValue.displayValue returning 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ø).Overlay: Updated BarcodePainter to receive deviceOrientation and dynamically adjust cameraPreviewSize, fixing barcode overlay misalignment during device rotation changes .
[Android] Refactored orientation detection to use OrientationEventListener instead of BroadcastReceiver for ACTION_CONFIGURATION_CHANGED, ensuring physical device orientation is captured correctly and preventing unwanted screen rotations on MobileScanner initialization .
[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.
Nothing published for this version
[Android] Removed deprecated renderscript api's, improved performance for analysis.
Overlay: Updated BarcodePainter to receive deviceOrientation and dynamically adjust cameraPreviewSize, fixing barcode overlay misalignment during device rotation changes .
[Android] Refactored orientation detection to use OrientationEventListener instead of BroadcastReceiver for ACTION_CONFIGURATION_CHANGED, ensuring physical device orientation is captured correctly and preventing unwanted screen rotations on MobileScanner initialization .
[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.
Fixed an issue with the initialZoom parameter.
initialZoom parameter.Fixed missing import of 'package:meta/meta.dart' on older Flutter sdk's
[Apple & Android] Added tap to focus functionality. You can enable it in the MobileScanner widget.
Highlights
MobileScanner widget.initialZoom parameter in the startOptions.Bug Fixes and Improvements
Barcode.scaleCorners() method.Added error handling for when MobileScannerController.start is called without an active MobileScanner widget.
MobileScannerController.start is called without an active MobileScanner widget.This version finalizes all changes from the beta and release candidate cycles and introduces major improvements, bug fixes, and breaking changes.
This version finalizes all changes from the beta and release candidate cycles and introduces major improvements, bug fixes, and breaking changes.
BREAKING CHANGES
MobileScannerState is now CameraFacing.unknown.EncryptionType.none. Use EncryptionType.unknown instead.errorBuilder and placeholderBuilder no longer have a Widget argument.MobileScannerErrorBuilder typedef.Highlights
kotlin-bom and updated CameraX and camera-camera2 dependencies.MobileScannerErrorCode now includes readable error messages in debug mode.autoZoom, invertImage, and lifecycle handling.Bug Fixes and Improvements
SurfaceProducer with Kotlin 1.8+.[Apple] Fixed build issues "Cannot use optional chaining on non-optional value".
Bugs fixed:
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.
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:
org.jetbrains.kotlin:kotlin-bom.MobileScannerErrorCode, which will be shown if kDebugMode is true. Otherwise, a generic error message will appear.MobileScannerController, which could result in a black screen without error message.Bugs fixed:
This release requires Flutter 3.29.0 or higher.
BREAKING CHANGES:
Bugs fixed:
onSurfaceCleanup callback.Updated examples in example app.
Improvements:
Bugs fixed:
The initial state of the MobileScannerState camera facing direction is changed to CameraFacing.unknown.
BREAKING CHANGES:
MobileScannerState camera facing direction is changed to CameraFacing.unknown.Improvements:
Log.ERROR logging level.CameraFacing.external and CameraFacing.unknown enum values.Bugs fixed:
This release requires Flutter 3.27.0 or higher.
BREAKING CHANGES:
Improvements:
rawBytes from the Vision API observations.MobileScannerViewAttributes and StartOptions types, to allow them in tests.Bugs fixed:
[Android] Added autoZoom parameter to auto zoom if the detected code is to far from the camera.
Improvements:
autoZoom parameter to auto zoom if the detected code is to far from the camera.invertImage parameter to invert image colors for analyzer to support white-on-black barcodes, which are not supported by MLKit.Bugs fixed:
The deprecated EncryptionType.none constant has been removed. Use EncryptionType.unknown instead.
BREAKING CHANGES:
updateScanWindow method is now private. Instead, update the scan window in the MobileScanner widget directly.EncryptionType.none constant has been removed. Use EncryptionType.unknown instead.errorBuilder and placeholderBuilder of the MobileScanner widget no longer take a Widget argument, as it was unused.MobileScannerErrorBuilder typedef has been removed.Bugs fixed:
analyzeImage would not throw an error if no valid image is provided as argument.analyzeImage would not return if no barcodes are found in the image.analyzeImage would not return if no valid image is provided as argument.Improvements:
17.3.0.color and style properties to the BarcodePainter widget.* Fixed a build issue on macOS.
[Apple] Fixed an issue with the zoom slider being non-functional.
Bugs fixed:
Improvements:
Known issues:
[iOS] Migrate to the Vision API.
Improvements:
Known issues:
[Android] Update camerax dependencies to support 16KB pages sizes.
[Apple] Fixed a crash when stopping the camera when the camera device is nil.
Fixed onDetect not working when a MobileScannerController is provided.
Fixed onDetect not working when a MobileScannerController is provided.
[Android] Remove the dependency on org.jetbrains.kotlin:kotlin-bom.
Improvements:
org.jetbrains.kotlin:kotlin-bom.MobileScannerErrorCode, which will be shown if kDebugMode is true. Otherwise, a generic error message will appear.MobileScannerController, which could result in a black screen without error message.[Android] Updated bundled barcode scanning library to v17.3.0
Improvements:
[web] Fixed a bug that prevented color inverted barcodes from being scanned.
Bugs fixed:
Improvements:
[Android] Fixed crash due to imageProxy being closed too early.
Bugs fixed:
[Android] Fixed UI stutter when returnImage is true.
Bugs fixed:
returnImage is true.Adds pause function to pause the camera but keep textures in place.
New features:
Fixed a bug that prevented analyzeImage from actually accepting the configured formats.
Bugs fixed:
analyzeImage from actually accepting the configured formats.Improvements:
arm64 architecture for Simulators, which is unsupported by MLKit 7.0.0.Fixed a bug that would cause onDetect to not handle errors.
Bugs fixed:
Improvements:
armv7 architecture, which is unsupported by MLKit 7.0.0.onDetectError error handler to the MobileScanner widget, for use with onDetect.[iOS] iOS 15.5.0 is now the minimum supported iOS version.
BREAKING CHANGES:
Improvements:
analyzeImage.hasCameraPermission for the MobileScannerState.isInitialized,
the sample recommends using hasCameraPermission, which also guards against camera permission errors.returnImage to only determine if the camera output bytes should be sent.BarcodeCapture.size to always be provided when available, regardless of returnImage.Bugs fixed:
anaylzeImage() sample from working properly.The EncryptionType.none constant has been deprecated, as its name was misleading. Use EncryptionType.unknown instead.
Deprecations:
EncryptionType.none constant has been deprecated, as its name was misleading. Use EncryptionType.unknown instead.Bugs fixed:
EncryptionType throwing on invalid SAE encryption type.controls attribute on the video preview.Improvements:
unknown for unrecognized values.[MacOS] Adds Swift Package Manager support.
Improvements:
returnImage.size property to Barcode, that denotes the bounding box of the barcode.Bugs fixed:
size and image of BarcodeCapture.returnImage.Updates the package:web dependency to use a version range.
package:web dependency to use a version range.This release requires Flutter 3.22.0 and Dart 3.4.
This release requires Flutter 3.22.0 and Dart 3.4.
package:web to 1.0.0.This release fixes an issue with automatic starts in the examples.
This updates reverts a few breaking changes made in v5.0.0 in order to keep things simple.
This updates reverts a few breaking changes made in v5.0.0 in order to keep things simple.
onDetect method has been reinstated in the MobileScanner widget, but is nullable. You can
still listen to MobileScannerController.barcodes directly by passing null to this parameter.autoStart attribute has been reinstated in the MobileScannerController and 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 call MobileScannerController.start({CameraFacing? cameraDirection}).controller is no longer required in the MobileScanner widget. However if provided, the user should take care
of disposing it.Fixed a crash when the controller is disposed while it is still starting. #1036 (thanks @EArminjon !)
Bugs fixed:
Improvements:
Adjusted the platform checks to use the defaultTargetPlatform API, so that tests can use the correct platform overrides.
Improvements:
This major release contains all the changes from the 5.0.0 beta releases, along with the following changes:
This major release contains all the changes from the 5.0.0 beta releases, along with the following changes:
Improvements:
Flutter 3.19.0 is now required.
BREAKING CHANGES:
Bugs fixed:
Improvements:
Fixed an issue where the scan window was not updated when its size was changed. (thanks @navaronbracke !)
Bugs fixed:
The width and height of BarcodeCapture have been removed, in favor of size.
BREAKING CHANGES:
width and height of BarcodeCapture have been removed, in favor of size.raw attribute is now Object? instead of dynamic, so that it participates in type promotion.MobileScannerArguments class has been removed from the public API, as it is an internal type.cameraFacingOverride named argument for the start() method has been renamed to cameraDirection.analyzeImage function now correctly returns a BarcodeCapture? instead of a boolean.formats attribute of the MobileScannerController is now non-null.MobileScannerState enum has been renamed to MobileScannerAuthorizationState.ValueNotifiers for the camera state have been removed. Use the value of the MobileScannerController instead.hasTorch getter has been removed. Instead, use the torch state of the controller's value.
The TorchState enum now provides a new value for unavailable flashlights.autoStart attribute has been removed from the MobileScannerController. The controller should be manually started on-demand.MobileScanner widget.onPermissionSet, onStart and onScannerStarted methods have been removed from the MobileScanner widget. Instead, await MobileScannerController.start().startDelay has been removed from the MobileScanner widget. Instead, use a delay between manual starts of one or more controllers.onDetect method has been removed from the MobileScanner widget. Instead, listen to MobileScannerController.barcodes directly.overlay widget of the MobileScanner has been replaced by a new property, overlayBuilder, which provides the constraints for the overlay.TorchState.unavailable.1.0.Improvements:
MobileScannerController is now a ChangeNotifier, with MobileScannerState as its model.[iOS] Fixed a crash with a nil capture session when starting the camera. (thanks @navaronbracke !)
Bugs fixed:
[Android] compileSdk has been upgraded to version 34.
BREAKING CHANGES:
Updated js dependency together with other dependencies.
Improvements:
[web] Fixed a crash with the ZXing barcode format (thanks @hazzo!)
Bugs fixed:
Improvements:
Fixed a bug where the scanner would get stuck after denying permissions on Android. (thanks @navaronbracke !)
Bugs fixed:
Fixed a bug with an implicit conversion to integer for the scan timeout for iOS. (thanks @EArminjon !)
Bugs fixed:
Nothing published for this version
Updated to play-services-mlkit-barcode-scanning version 18.3.0
Improvements:
play-services-mlkit-barcode-scanning version 18.3.0Bugs fixed:
updateScanWindow() function not completing on Android and MacOS. (thanks @navaronbracke !)noDuplicates detection speed. (thanks @pgeof !)The type of an Address is now non-null.
Improvements:
type of an Address is now non-null.type of an Email is now non-null.phoneNumber of an SMS is now non-null.latitude and longitude of a GeoPoint are now non-null.phones and urls of ContactInfo are now non-null.url of a UrlBookmark is now non-null.type of Phone is now non-null.width and height of BarcodeCapture are now non-null.BarcodeCapture class now exposes a size.corners of a Barcode is now non-null.Bugs fixed:
format and type arguments of the Barcode constructor.
These now use BarcodeFormat.unknown and BarcodeType.unknown, rather than BarcodeFormat.ean13 and BarcodeType.text.
(thanks @navaronbracke !)NOTE: From this version onwards, `mobile_scanner` requires Android projects to have a `compileSdk` of 34 (Android 14) or higher
NOTE: From this version onwards, mobile_scanner requires Android projects to have a compileSdk of 34 (Android 14) or higher
New Features:
Bugs fixed:
Improvements:
Changed MediaQuery.sizeOf(context) to of(context).size for compatibility with older Flutter versions.
This PR adds an option to add an overlay to the scanner which is only visible when the scanner has started. (thanks @svenopdehipt !)
New Features:
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 !)
Your coding agent can read these notes before it upgrades. Set up the MCP server →