From 97b800c1a6d7de042d37724d1f5cc483f317bd01 Mon Sep 17 00:00:00 2001 From: FMorschel <52160996+FMorschel@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:45:39 -0300 Subject: [PATCH 1/3] fixes future warning for `await`ing `Future` returns in `async` bodies inside `try` blocks --- packages/camera/camera/example/lib/main.dart | 2 +- packages/camera/camera/lib/src/camera_controller.dart | 8 ++++---- packages/camera/camera_android/example/lib/main.dart | 2 +- .../example/lib/camera_controller.dart | 8 ++++---- .../camera/camera_android_camerax/example/lib/main.dart | 2 +- packages/camera/camera_avfoundation/example/lib/main.dart | 2 +- packages/google_fonts/lib/src/google_fonts_base.dart | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/camera/camera/example/lib/main.dart b/packages/camera/camera/example/lib/main.dart index 9185f3e34f1e..cca528c04fda 100644 --- a/packages/camera/camera/example/lib/main.dart +++ b/packages/camera/camera/example/lib/main.dart @@ -888,7 +888,7 @@ class _CameraExampleHomeState extends State } try { - return cameraController.stopVideoRecording(); + return await cameraController.stopVideoRecording(); } on CameraException catch (e) { _showCameraException(e); return null; diff --git a/packages/camera/camera/lib/src/camera_controller.dart b/packages/camera/camera/lib/src/camera_controller.dart index 3656e4d67ab9..8492cda13b8b 100644 --- a/packages/camera/camera/lib/src/camera_controller.dart +++ b/packages/camera/camera/lib/src/camera_controller.dart @@ -766,7 +766,7 @@ class CameraController extends ValueNotifier { Future getMinExposureOffset() async { _throwIfNotInitialized('getMinExposureOffset'); try { - return CameraPlatform.instance.getMinExposureOffset(_cameraId); + return await CameraPlatform.instance.getMinExposureOffset(_cameraId); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -776,7 +776,7 @@ class CameraController extends ValueNotifier { Future getMaxExposureOffset() async { _throwIfNotInitialized('getMaxExposureOffset'); try { - return CameraPlatform.instance.getMaxExposureOffset(_cameraId); + return await CameraPlatform.instance.getMaxExposureOffset(_cameraId); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -788,7 +788,7 @@ class CameraController extends ValueNotifier { Future getExposureOffsetStepSize() async { _throwIfNotInitialized('getExposureOffsetStepSize'); try { - return CameraPlatform.instance.getExposureOffsetStepSize(_cameraId); + return await CameraPlatform.instance.getExposureOffsetStepSize(_cameraId); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -833,7 +833,7 @@ class CameraController extends ValueNotifier { } try { - return CameraPlatform.instance.setExposureOffset(_cameraId, offset); + return await CameraPlatform.instance.setExposureOffset(_cameraId, offset); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } diff --git a/packages/camera/camera_android/example/lib/main.dart b/packages/camera/camera_android/example/lib/main.dart index 999b281f2293..b669f6ac6831 100644 --- a/packages/camera/camera_android/example/lib/main.dart +++ b/packages/camera/camera_android/example/lib/main.dart @@ -908,7 +908,7 @@ class _CameraExampleHomeState extends State } try { - return cameraController.stopVideoRecording(); + return await cameraController.stopVideoRecording(); } on CameraException catch (e) { _showCameraException(e); return null; diff --git a/packages/camera/camera_android_camerax/example/lib/camera_controller.dart b/packages/camera/camera_android_camerax/example/lib/camera_controller.dart index e09dfb861049..c9f989df5250 100644 --- a/packages/camera/camera_android_camerax/example/lib/camera_controller.dart +++ b/packages/camera/camera_android_camerax/example/lib/camera_controller.dart @@ -716,7 +716,7 @@ class CameraController extends ValueNotifier { Future getMinExposureOffset() async { _throwIfNotInitialized('getMinExposureOffset'); try { - return CameraPlatform.instance.getMinExposureOffset(_cameraId); + return await CameraPlatform.instance.getMinExposureOffset(_cameraId); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -726,7 +726,7 @@ class CameraController extends ValueNotifier { Future getMaxExposureOffset() async { _throwIfNotInitialized('getMaxExposureOffset'); try { - return CameraPlatform.instance.getMaxExposureOffset(_cameraId); + return await CameraPlatform.instance.getMaxExposureOffset(_cameraId); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -738,7 +738,7 @@ class CameraController extends ValueNotifier { Future getExposureOffsetStepSize() async { _throwIfNotInitialized('getExposureOffsetStepSize'); try { - return CameraPlatform.instance.getExposureOffsetStepSize(_cameraId); + return await CameraPlatform.instance.getExposureOffsetStepSize(_cameraId); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } @@ -783,7 +783,7 @@ class CameraController extends ValueNotifier { } try { - return CameraPlatform.instance.setExposureOffset(_cameraId, offset); + return await CameraPlatform.instance.setExposureOffset(_cameraId, offset); } on PlatformException catch (e) { throw CameraException(e.code, e.message); } diff --git a/packages/camera/camera_android_camerax/example/lib/main.dart b/packages/camera/camera_android_camerax/example/lib/main.dart index 956a86b20167..c3aba39ed60f 100644 --- a/packages/camera/camera_android_camerax/example/lib/main.dart +++ b/packages/camera/camera_android_camerax/example/lib/main.dart @@ -898,7 +898,7 @@ class _CameraExampleHomeState extends State } try { - return cameraController.stopVideoRecording(); + return await cameraController.stopVideoRecording(); } on CameraException catch (e) { _showCameraException(e); return null; diff --git a/packages/camera/camera_avfoundation/example/lib/main.dart b/packages/camera/camera_avfoundation/example/lib/main.dart index 0df8ebe185f8..f9576b96398f 100644 --- a/packages/camera/camera_avfoundation/example/lib/main.dart +++ b/packages/camera/camera_avfoundation/example/lib/main.dart @@ -903,7 +903,7 @@ class _CameraExampleHomeState extends State } try { - return cameraController.stopVideoRecording(); + return await cameraController.stopVideoRecording(); } on CameraException catch (e) { _showCameraException(e); return null; diff --git a/packages/google_fonts/lib/src/google_fonts_base.dart b/packages/google_fonts/lib/src/google_fonts_base.dart index 2f0db1178859..93a6e630a2e7 100755 --- a/packages/google_fonts/lib/src/google_fonts_base.dart +++ b/packages/google_fonts/lib/src/google_fonts_base.dart @@ -151,7 +151,7 @@ Future loadFontIfNecessary(GoogleFontsDescriptor descriptor) async { byteData = rootBundle.load(assetPath); } if (await byteData != null) { - return loadFontByteData(familyWithVariantString, byteData); + return await loadFontByteData(familyWithVariantString, byteData); } // Check if this font can be loaded from the device file system. @@ -161,7 +161,7 @@ Future loadFontIfNecessary(GoogleFontsDescriptor descriptor) async { ); if (await byteData != null) { - return loadFontByteData(familyWithVariantString, byteData); + return await loadFontByteData(familyWithVariantString, byteData); } // Attempt to load this font via http, unless disallowed. @@ -171,7 +171,7 @@ Future loadFontIfNecessary(GoogleFontsDescriptor descriptor) async { descriptor.file, ); if (await byteData != null) { - return loadFontByteData(familyWithVariantString, byteData); + return await loadFontByteData(familyWithVariantString, byteData); } } else { throw Exception( From 6fd477ad3ff5a255bf4fb71a91173b7da88fe5fb Mon Sep 17 00:00:00 2001 From: FMorschel <52160996+FMorschel@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:01:44 -0300 Subject: [PATCH 2/3] bump versions and update changelogs for camera and google_fonts packages --- packages/camera/camera/CHANGELOG.md | 32 ++++++++++++------- packages/camera/camera/pubspec.yaml | 2 +- packages/camera/camera_android/CHANGELOG.md | 4 +++ packages/camera/camera_android/pubspec.yaml | 2 +- .../camera_android_camerax/CHANGELOG.md | 14 +++++--- .../camera_android_camerax/pubspec.yaml | 2 +- .../camera/camera_avfoundation/CHANGELOG.md | 4 +++ .../camera/camera_avfoundation/pubspec.yaml | 2 +- packages/google_fonts/CHANGELOG.md | 10 ++++-- packages/google_fonts/pubspec.yaml | 2 +- 10 files changed, 50 insertions(+), 24 deletions(-) diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 38add27ff171..686978fe2a91 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.11.4 + +* Fixes a bug where exceptions thrown during a return statement in an async function were not correctly caught, aligning behavior with expected Dart semantics (see [dart-lang/sdk#44395](https://github.com/dart-lang/sdk/issues/44395)). +* Updates example to demonstrate correct exception handling for async return statements, ensuring exceptions thrown during return are properly caught as per [dart-lang/sdk#44395](https://github.com/dart-lang/sdk/issues/44395). + ## 0.11.3+1 * Fixes delivering errors from onCameraError. @@ -479,10 +484,11 @@ Updated README to inform users that iOS 10.0+ is needed for use As part of implementing federated architecture and making the interface compatible with the web this version contains the following **breaking changes**: Method changes in `CameraController`: -- The `takePicture` method no longer accepts the `path` parameter, but instead returns the captured image as an instance of the `XFile` class; -- The `startVideoRecording` method no longer accepts the `filePath`. Instead the recorded video is now returned as a `XFile` instance when the `stopVideoRecording` method completes; -- The `stopVideoRecording` method now returns the captured video when it completes; -- Added the `buildPreview` method which is now used to implement the CameraPreview widget. + +* The `takePicture` method no longer accepts the `path` parameter, but instead returns the captured image as an instance of the `XFile` class; +* The `startVideoRecording` method no longer accepts the `filePath`. Instead the recorded video is now returned as a `XFile` instance when the `stopVideoRecording` method completes; +* The `stopVideoRecording` method now returns the captured video when it completes; +* Added the `buildPreview` method which is now used to implement the CameraPreview widget. ## 0.5.8+19 @@ -787,16 +793,18 @@ a `MissingPluginException.` A lot of **breaking changes** in this version: Getter changes: - - Removed `isStarted` - - Renamed `initialized` to `isInitialized` - - Added `isRecordingVideo` + +* Removed `isStarted` +* Renamed `initialized` to `isInitialized` +* Added `isRecordingVideo` Method changes: - - Renamed `capture` to `takePicture` - - Removed `start` (the preview starts automatically when `initialize` is called) - - Added `startVideoRecording(String filePath)` - - Removed `stop` (the preview stops automatically when `dispose` is called) - - Added `stopVideoRecording` + +* Renamed `capture` to `takePicture` +* Removed `start` (the preview starts automatically when `initialize` is called) +* Added `startVideoRecording(String filePath)` +* Removed `stop` (the preview stops automatically when `dispose` is called) +* Added `stopVideoRecording` ## 0.1.2 diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 327b922a2b00..8623cf61e14a 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing Dart. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.11.3+1 +version: 0.11.4 environment: sdk: ^3.9.0 diff --git a/packages/camera/camera_android/CHANGELOG.md b/packages/camera/camera_android/CHANGELOG.md index 6ebd56630b06..916e152799a0 100644 --- a/packages/camera/camera_android/CHANGELOG.md +++ b/packages/camera/camera_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.10+15 + +* Updates example to demonstrate correct exception handling for async return statements, ensuring exceptions thrown during return are properly caught as per [dart-lang/sdk#44395](https://github.com/dart-lang/sdk/issues/44395). + ## 0.10.10+14 * Bumps com.android.tools.build:gradle from 8.12.1 to 8.13.1. diff --git a/packages/camera/camera_android/pubspec.yaml b/packages/camera/camera_android/pubspec.yaml index f5dbe700d346..4448279e3a32 100644 --- a/packages/camera/camera_android/pubspec.yaml +++ b/packages/camera/camera_android/pubspec.yaml @@ -3,7 +3,7 @@ description: Android implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.10.10+14 +version: 0.10.10+15 environment: sdk: ^3.9.0 diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 96664813481e..d723a308b1db 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.30+1 + +* Updates example to demonstrate correct exception handling for async return statements, ensuring exceptions thrown during return are properly caught as per [dart-lang/sdk#44395](https://github.com/dart-lang/sdk/issues/44395). + ## 0.6.30 * Bump camerax_version from 1.5.2 to 1.5.3. @@ -375,7 +379,7 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github * Modifies `buildPreview` to return `Texture` that maps to camera preview, building in the assumption that `createCamera` should have been called before building the preview. Fixes - https://github.com/flutter/flutter/issues/140567. + . ## 0.5.0+28 @@ -501,9 +505,9 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github ## 0.5.0 * Initial release of this `camera` implementation that supports: - * Image capture - * Video recording - * Displaying a live camera preview - * Image streaming + * Image capture + * Video recording + * Displaying a live camera preview + * Image streaming See [`README.md`](README.md) for more details on the limitations of this implementation. diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index e08a62897458..9a35b4fd7f08 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android_camerax description: Android implementation of the camera plugin using the CameraX library. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.6.30 +version: 0.6.30+1 environment: sdk: ^3.9.0 diff --git a/packages/camera/camera_avfoundation/CHANGELOG.md b/packages/camera/camera_avfoundation/CHANGELOG.md index f66df6476e7d..14f7fe829a88 100644 --- a/packages/camera/camera_avfoundation/CHANGELOG.md +++ b/packages/camera/camera_avfoundation/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.23+3 + +* Updates example to demonstrate correct exception handling for async return statements, ensuring exceptions thrown during return are properly caught as per [dart-lang/sdk#44395](https://github.com/dart-lang/sdk/issues/44395). + ## 0.9.23+2 * Code refactor related to Swift pigeon's generated struct MediaSettings being immutable. diff --git a/packages/camera/camera_avfoundation/pubspec.yaml b/packages/camera/camera_avfoundation/pubspec.yaml index 1e87023aa7b0..241456f0c5d1 100644 --- a/packages/camera/camera_avfoundation/pubspec.yaml +++ b/packages/camera/camera_avfoundation/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_avfoundation description: iOS implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_avfoundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.9.23+2 +version: 0.9.23+3 environment: sdk: ^3.9.0 diff --git a/packages/google_fonts/CHANGELOG.md b/packages/google_fonts/CHANGELOG.md index 5db0d9c11778..30c73674e103 100644 --- a/packages/google_fonts/CHANGELOG.md +++ b/packages/google_fonts/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.0.2 + +- Fixes a bug where exceptions thrown during a return statement in an async function were not correctly caught, aligning behavior with expected Dart semantics (see [dart-lang/sdk#44395](https://github.com/dart-lang/sdk/issues/44395)). + ## 8.0.1 - Fixes WOFF2/WOFF font selection when loading fonts bundled with the app to prefer compressed formats regardless of asset manifest order. @@ -266,8 +270,8 @@ ## 6.3.1 - Transfers the package source from - https://github.com/material-foundation/flutter-packages to - https://github.com/flutter/packages. + to + . - Updates minimum supported SDK version to Flutter 3.29/Dart 3.7. - Updates code to meet repository analyzer settings. @@ -679,7 +683,9 @@ - `Yuji Hentaigana Akebono` ## 3.0.1 + ### Changed + - Improve asset manifest loading errors - Improve testing guidance diff --git a/packages/google_fonts/pubspec.yaml b/packages/google_fonts/pubspec.yaml index 37bca4191329..021ef5dff338 100644 --- a/packages/google_fonts/pubspec.yaml +++ b/packages/google_fonts/pubspec.yaml @@ -2,7 +2,7 @@ name: google_fonts description: A Flutter package to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling. repository: https://github.com/flutter/packages/tree/main/packages/google_fonts issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_fonts%22 -version: 8.0.1 +version: 8.0.2 environment: sdk: ^3.9.0 From cb54100c7d1bb33f500a2cd86355e16be9b755fd Mon Sep 17 00:00:00 2001 From: FMorschel <52160996+FMorschel@users.noreply.github.com> Date: Fri, 13 Feb 2026 10:36:54 -0300 Subject: [PATCH 3/3] undo chanegs to old changelog entries --- packages/camera/camera/CHANGELOG.md | 29 +++++++++---------- .../camera_android_camerax/CHANGELOG.md | 12 ++++---- packages/google_fonts/CHANGELOG.md | 8 ++--- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 686978fe2a91..9fc9ad49bcf4 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -484,11 +484,10 @@ Updated README to inform users that iOS 10.0+ is needed for use As part of implementing federated architecture and making the interface compatible with the web this version contains the following **breaking changes**: Method changes in `CameraController`: - -* The `takePicture` method no longer accepts the `path` parameter, but instead returns the captured image as an instance of the `XFile` class; -* The `startVideoRecording` method no longer accepts the `filePath`. Instead the recorded video is now returned as a `XFile` instance when the `stopVideoRecording` method completes; -* The `stopVideoRecording` method now returns the captured video when it completes; -* Added the `buildPreview` method which is now used to implement the CameraPreview widget. +- The `takePicture` method no longer accepts the `path` parameter, but instead returns the captured image as an instance of the `XFile` class; +- The `startVideoRecording` method no longer accepts the `filePath`. Instead the recorded video is now returned as a `XFile` instance when the `stopVideoRecording` method completes; +- The `stopVideoRecording` method now returns the captured video when it completes; +- Added the `buildPreview` method which is now used to implement the CameraPreview widget. ## 0.5.8+19 @@ -793,18 +792,16 @@ a `MissingPluginException.` A lot of **breaking changes** in this version: Getter changes: - -* Removed `isStarted` -* Renamed `initialized` to `isInitialized` -* Added `isRecordingVideo` + - Removed `isStarted` + - Renamed `initialized` to `isInitialized` + - Added `isRecordingVideo` Method changes: - -* Renamed `capture` to `takePicture` -* Removed `start` (the preview starts automatically when `initialize` is called) -* Added `startVideoRecording(String filePath)` -* Removed `stop` (the preview stops automatically when `dispose` is called) -* Added `stopVideoRecording` + - Renamed `capture` to `takePicture` + - Removed `start` (the preview starts automatically when `initialize` is called) + - Added `startVideoRecording(String filePath)` + - Removed `stop` (the preview stops automatically when `dispose` is called) + - Added `stopVideoRecording` ## 0.1.2 @@ -836,4 +833,4 @@ Method changes: ## 0.0.1 -* Initial release +* Initial release \ No newline at end of file diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index d723a308b1db..b003df7a8988 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -379,7 +379,7 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github * Modifies `buildPreview` to return `Texture` that maps to camera preview, building in the assumption that `createCamera` should have been called before building the preview. Fixes - . + https://github.com/flutter/flutter/issues/140567. ## 0.5.0+28 @@ -505,9 +505,9 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github ## 0.5.0 * Initial release of this `camera` implementation that supports: - * Image capture - * Video recording - * Displaying a live camera preview - * Image streaming + * Image capture + * Video recording + * Displaying a live camera preview + * Image streaming - See [`README.md`](README.md) for more details on the limitations of this implementation. + See [`README.md`](README.md) for more details on the limitations of this implementation. \ No newline at end of file diff --git a/packages/google_fonts/CHANGELOG.md b/packages/google_fonts/CHANGELOG.md index 30c73674e103..291d2284d4cd 100644 --- a/packages/google_fonts/CHANGELOG.md +++ b/packages/google_fonts/CHANGELOG.md @@ -270,8 +270,8 @@ ## 6.3.1 - Transfers the package source from - to - . + https://github.com/material-foundation/flutter-packages to + https://github.com/flutter/packages. - Updates minimum supported SDK version to Flutter 3.29/Dart 3.7. - Updates code to meet repository analyzer settings. @@ -683,9 +683,7 @@ - `Yuji Hentaigana Akebono` ## 3.0.1 - ### Changed - - Improve asset manifest loading errors - Improve testing guidance @@ -1008,4 +1006,4 @@ - Initial release: supports all 960 fonts and variants from fonts.google.com - ttf files are downloaded via http on demand, and saved to local disk so that they can be loaded without making another http request for future font requests -- Fonts are loaded asynchronously through the font loader and Text widgets that use them are refreshed when they are ready +- Fonts are loaded asynchronously through the font loader and Text widgets that use them are refreshed when they are ready \ No newline at end of file