Committed by
GitHub
Merge pull request #914 from navaronbracke/release-3-5-6
chore: prepare release 3.5.6
Showing
11 changed files
with
32 additions
and
24 deletions
| 1 | -## NEXT | 1 | +## 3.5.6 |
| 2 | +Bugs fixed: | ||
| 3 | +* [web] Fixed a crash with the ZXing barcode format (thanks @hazzo!) | ||
| 4 | +* [web] Fixed stream controller not being closed on web. | ||
| 5 | +* [iOS] Fixed a crash with unsupported torch modes. (thanks @navaronbracke !) | ||
| 6 | +* [iOS] Fixed a crash with the camera discovery session. (thanks @navaronbracke !) | ||
| 7 | + | ||
| 2 | Improvements: | 8 | Improvements: |
| 3 | -* Fixed stream controller not being closed on web. | ||
| 4 | * Upgrade camera dependencies on Android. | 9 | * Upgrade camera dependencies on Android. |
| 5 | -* Check if torch mode is supported on iOS | ||
| 6 | * Upgrade compileSdk version to 34 on Android. | 10 | * Upgrade compileSdk version to 34 on Android. |
| 7 | -* Add nrOfCameras parameter in MobileScannerArguments callback, which shows how many cameras there are available on Android. | 11 | +* Add numberOfCameras parameter in MobileScannerArguments callback, which shows how many cameras there are available on Android. |
| 8 | * [Android] Migrated to ResolutionSelector with ResolutionStrategy. You can opt in into the new selector by setting [useNewCameraSelector] in the [MobileScannerController] to true. | 12 | * [Android] Migrated to ResolutionSelector with ResolutionStrategy. You can opt in into the new selector by setting [useNewCameraSelector] in the [MobileScannerController] to true. |
| 9 | -* [iOS] Added new CameraSelector | ||
| 10 | - | ||
| 11 | 13 | ||
| 12 | ## 3.5.5 | 14 | ## 3.5.5 |
| 13 | Bugs fixed: | 15 | Bugs fixed: |
| @@ -250,7 +250,7 @@ class MobileScanner( | @@ -250,7 +250,7 @@ class MobileScanner( | ||
| 250 | 250 | ||
| 251 | cameraProviderFuture.addListener({ | 251 | cameraProviderFuture.addListener({ |
| 252 | cameraProvider = cameraProviderFuture.get() | 252 | cameraProvider = cameraProviderFuture.get() |
| 253 | - val nrOfCameras = cameraProvider?.availableCameraInfos?.size | 253 | + val numberOfCameras = cameraProvider?.availableCameraInfos?.size |
| 254 | 254 | ||
| 255 | if (cameraProvider == null) { | 255 | if (cameraProvider == null) { |
| 256 | mobileScannerErrorCallback(CameraError()) | 256 | mobileScannerErrorCallback(CameraError()) |
| @@ -374,7 +374,7 @@ class MobileScanner( | @@ -374,7 +374,7 @@ class MobileScanner( | ||
| 374 | if (portrait) height else width, | 374 | if (portrait) height else width, |
| 375 | camera?.cameraInfo?.hasFlashUnit() ?: false, | 375 | camera?.cameraInfo?.hasFlashUnit() ?: false, |
| 376 | textureEntry!!.id(), | 376 | textureEntry!!.id(), |
| 377 | - nrOfCameras ?: 0 | 377 | + numberOfCameras ?: 0 |
| 378 | ) | 378 | ) |
| 379 | ) | 379 | ) |
| 380 | }, executor) | 380 | }, executor) |
| @@ -180,7 +180,7 @@ class MobileScannerHandler( | @@ -180,7 +180,7 @@ class MobileScannerHandler( | ||
| 180 | "textureId" to it.id, | 180 | "textureId" to it.id, |
| 181 | "size" to mapOf("width" to it.width, "height" to it.height), | 181 | "size" to mapOf("width" to it.width, "height" to it.height), |
| 182 | "torchable" to it.hasFlashUnit, | 182 | "torchable" to it.hasFlashUnit, |
| 183 | - "nrOfCameras" to it.nrOfCameras | 183 | + "numberOfCameras" to it.numberOfCameras |
| 184 | )) | 184 | )) |
| 185 | } | 185 | } |
| 186 | }, | 186 | }, |
| @@ -47,7 +47,7 @@ class _BarcodeScannerWithControllerState | @@ -47,7 +47,7 @@ class _BarcodeScannerWithControllerState | ||
| 47 | } | 47 | } |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | - int? nrOfCameras; | 50 | + int? numberOfCameras; |
| 51 | 51 | ||
| 52 | @override | 52 | @override |
| 53 | Widget build(BuildContext context) { | 53 | Widget build(BuildContext context) { |
| @@ -60,8 +60,8 @@ class _BarcodeScannerWithControllerState | @@ -60,8 +60,8 @@ class _BarcodeScannerWithControllerState | ||
| 60 | children: [ | 60 | children: [ |
| 61 | MobileScanner( | 61 | MobileScanner( |
| 62 | onScannerStarted: (arguments) { | 62 | onScannerStarted: (arguments) { |
| 63 | - if (arguments?.nrOfCameras != null) { | ||
| 64 | - nrOfCameras = arguments!.nrOfCameras; | 63 | + if (mounted && arguments?.numberOfCameras != null) { |
| 64 | + numberOfCameras = arguments!.numberOfCameras; | ||
| 65 | setState(() {}); | 65 | setState(() {}); |
| 66 | } | 66 | } |
| 67 | }, | 67 | }, |
| @@ -154,7 +154,7 @@ class _BarcodeScannerWithControllerState | @@ -154,7 +154,7 @@ class _BarcodeScannerWithControllerState | ||
| 154 | }, | 154 | }, |
| 155 | ), | 155 | ), |
| 156 | iconSize: 32.0, | 156 | iconSize: 32.0, |
| 157 | - onPressed: nrOfCameras != null && nrOfCameras! < 2 | 157 | + onPressed: (numberOfCameras ?? 0) < 2 |
| 158 | ? null | 158 | ? null |
| 159 | : () => controller.switchCamera(), | 159 | : () => controller.switchCamera(), |
| 160 | ), | 160 | ), |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | # | 4 | # |
| 5 | Pod::Spec.new do |s| | 5 | Pod::Spec.new do |s| |
| 6 | s.name = 'mobile_scanner' | 6 | s.name = 'mobile_scanner' |
| 7 | - s.version = '3.5.5' | 7 | + s.version = '3.5.6' |
| 8 | s.summary = 'An universal scanner for Flutter based on MLKit.' | 8 | s.summary = 'An universal scanner for Flutter based on MLKit.' |
| 9 | s.description = <<-DESC | 9 | s.description = <<-DESC |
| 10 | An universal scanner for Flutter based on MLKit. | 10 | An universal scanner for Flutter based on MLKit. |
| @@ -229,7 +229,7 @@ class _MobileScannerState extends State<MobileScanner> | @@ -229,7 +229,7 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 229 | value.size, | 229 | value.size, |
| 230 | value.webId, | 230 | value.webId, |
| 231 | value.textureId, | 231 | value.textureId, |
| 232 | - value.nrOfCameras, | 232 | + value.numberOfCameras, |
| 233 | ), | 233 | ), |
| 234 | widget.overlay!, | 234 | widget.overlay!, |
| 235 | ], | 235 | ], |
| @@ -239,7 +239,7 @@ class _MobileScannerState extends State<MobileScanner> | @@ -239,7 +239,7 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 239 | value.size, | 239 | value.size, |
| 240 | value.webId, | 240 | value.webId, |
| 241 | value.textureId, | 241 | value.textureId, |
| 242 | - value.nrOfCameras, | 242 | + value.numberOfCameras, |
| 243 | ); | 243 | ); |
| 244 | } | 244 | } |
| 245 | }, | 245 | }, |
| @@ -248,7 +248,12 @@ class _MobileScannerState extends State<MobileScanner> | @@ -248,7 +248,12 @@ class _MobileScannerState extends State<MobileScanner> | ||
| 248 | ); | 248 | ); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | - Widget _scanner(Size size, String? webId, int? textureId, int? nrOfCameras) { | 251 | + Widget _scanner( |
| 252 | + Size size, | ||
| 253 | + String? webId, | ||
| 254 | + int? textureId, | ||
| 255 | + int? numberOfCameras, | ||
| 256 | + ) { | ||
| 252 | return ClipRect( | 257 | return ClipRect( |
| 253 | child: LayoutBuilder( | 258 | child: LayoutBuilder( |
| 254 | builder: (_, constraints) { | 259 | builder: (_, constraints) { |
| @@ -312,7 +312,7 @@ class MobileScannerController { | @@ -312,7 +312,7 @@ class MobileScannerController { | ||
| 312 | 312 | ||
| 313 | isStarting = false; | 313 | isStarting = false; |
| 314 | return startArguments.value = MobileScannerArguments( | 314 | return startArguments.value = MobileScannerArguments( |
| 315 | - nrOfCameras: startResult['nrOfCameras'] as int?, | 315 | + numberOfCameras: startResult['numberOfCameras'] as int?, |
| 316 | size: size, | 316 | size: size, |
| 317 | hasTorch: hasTorch, | 317 | hasTorch: hasTorch, |
| 318 | textureId: kIsWeb ? null : startResult['textureId'] as int?, | 318 | textureId: kIsWeb ? null : startResult['textureId'] as int?, |
| @@ -16,14 +16,15 @@ class MobileScannerArguments { | @@ -16,14 +16,15 @@ class MobileScannerArguments { | ||
| 16 | final String? webId; | 16 | final String? webId; |
| 17 | 17 | ||
| 18 | /// Indicates how many cameras are available. | 18 | /// Indicates how many cameras are available. |
| 19 | - /// Only available on Android | ||
| 20 | - final int? nrOfCameras; | 19 | + /// |
| 20 | + /// Currently only supported on Android. | ||
| 21 | + final int? numberOfCameras; | ||
| 21 | 22 | ||
| 22 | MobileScannerArguments({ | 23 | MobileScannerArguments({ |
| 23 | required this.size, | 24 | required this.size, |
| 24 | required this.hasTorch, | 25 | required this.hasTorch, |
| 25 | this.textureId, | 26 | this.textureId, |
| 26 | this.webId, | 27 | this.webId, |
| 27 | - this.nrOfCameras, | 28 | + this.numberOfCameras, |
| 28 | }); | 29 | }); |
| 29 | } | 30 | } |
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | # | 4 | # |
| 5 | Pod::Spec.new do |s| | 5 | Pod::Spec.new do |s| |
| 6 | s.name = 'mobile_scanner' | 6 | s.name = 'mobile_scanner' |
| 7 | - s.version = '3.5.5' | 7 | + s.version = '3.5.6' |
| 8 | s.summary = 'An universal scanner for Flutter based on MLKit.' | 8 | s.summary = 'An universal scanner for Flutter based on MLKit.' |
| 9 | s.description = <<-DESC | 9 | s.description = <<-DESC |
| 10 | An universal scanner for Flutter based on MLKit. | 10 | An universal scanner for Flutter based on MLKit. |
| 1 | name: mobile_scanner | 1 | name: mobile_scanner |
| 2 | description: A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS. | 2 | description: A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS. |
| 3 | -version: 3.5.5 | 3 | +version: 3.5.6 |
| 4 | repository: https://github.com/juliansteenbakker/mobile_scanner | 4 | repository: https://github.com/juliansteenbakker/mobile_scanner |
| 5 | 5 | ||
| 6 | environment: | 6 | environment: |
-
Please register or login to post a comment