diff --git a/packages/camera/camera_android/CHANGELOG.md b/packages/camera/camera_android/CHANGELOG.md index 2e03d91b3bc2..b0c7ec25bf11 100644 --- a/packages/camera/camera_android/CHANGELOG.md +++ b/packages/camera/camera_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.10.8+9 + +* Removes usage of `_ambiguate` method in example. + ## 0.10.8+8 * Adds pub topics to package metadata. diff --git a/packages/camera/camera_android/example/lib/main.dart b/packages/camera/camera_android/example/lib/main.dart index dca906cf26cf..ed1528b41698 100644 --- a/packages/camera/camera_android/example/lib/main.dart +++ b/packages/camera/camera_android/example/lib/main.dart @@ -75,7 +75,7 @@ class _CameraExampleHomeState extends State @override void initState() { super.initState(); - _ambiguate(WidgetsBinding.instance)?.addObserver(this); + WidgetsBinding.instance.addObserver(this); _flashModeControlRowAnimationController = AnimationController( duration: const Duration(milliseconds: 300), @@ -105,7 +105,7 @@ class _CameraExampleHomeState extends State @override void dispose() { - _ambiguate(WidgetsBinding.instance)?.removeObserver(this); + WidgetsBinding.instance.removeObserver(this); _flashModeControlRowAnimationController.dispose(); _exposureModeControlRowAnimationController.dispose(); super.dispose(); @@ -580,7 +580,7 @@ class _CameraExampleHomeState extends State } if (_cameras.isEmpty) { - _ambiguate(SchedulerBinding.instance)?.addPostFrameCallback((_) async { + SchedulerBinding.instance.addPostFrameCallback((_) async { showInSnackBar('No camera found.'); }); return const Text('None'); @@ -1075,9 +1075,3 @@ Future main() async { } runApp(const CameraApp()); } - -/// This allows a value of type T or T? to be treated as a value of type T?. -/// -/// We use this so that APIs that have become non-nullable can still be used -/// with `!` and `?` on the stable branch. -T? _ambiguate(T? value) => value; diff --git a/packages/camera/camera_android/pubspec.yaml b/packages/camera/camera_android/pubspec.yaml index 59d1d3aaf488..f8a85ff916b8 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.8+8 +version: 0.10.8+9 environment: sdk: ">=2.19.0 <4.0.0"