Skip to content

Commit 0a2975d

Browse files
committed
fix old surface producer API
1 parent b927e69 commit 0a2975d

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 7.0.0-beta.9
2+
3+
**BREAKING CHANGES:**
4+
5+
* This release requires Flutter 3.29.0 or higher.
6+
7+
Bugs fixed:
8+
* [Android] Fixed a timing issue for the SurfaceProducer implementation, by switching to the `onSurfaceCleanup` callback.
9+
110
## 7.0.0-beta.8
211

312
Improvements:

android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ class MobileScanner(
233233
// whenever a new Surface is needed.
234234
}
235235

236-
// TODO: replace with "onSurfaceCleanup" when available in Flutter 3.28 or later
237-
// See https://github.com/flutter/flutter/pull/160937
238-
override fun onSurfaceDestroyed() {
236+
override fun onSurfaceCleanup() {
239237
// Invalidate the SurfaceRequest so that CameraX knows to to make a new request
240238
// for a surface.
241239
request.invalidate()

example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
66
version: 0.0.1
77

88
environment:
9-
sdk: ">=3.6.0 <4.0.0"
10-
flutter: ">=3.27.0"
9+
sdk: ">=3.7.0 <4.0.0"
10+
flutter: ">=3.29.0"
1111

1212
# Dependencies specify other packages that your package needs in order to work.
1313
# To automatically upgrade your package dependencies to the latest versions

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: mobile_scanner
22
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: 7.0.0-beta.8
3+
version: 7.0.0-beta.9
44
repository: https://github.com/juliansteenbakker/mobile_scanner
55

66
screenshots:
@@ -16,8 +16,8 @@ screenshots:
1616
path: example/screenshots/overlay.png
1717

1818
environment:
19-
sdk: ">=3.6.0 <4.0.0"
20-
flutter: ">=3.27.0"
19+
sdk: ">=3.7.0 <4.0.0"
20+
flutter: ">=3.29.0"
2121

2222
dependencies:
2323
collection: ">=1.15.0 <2.0.0"

0 commit comments

Comments
 (0)