Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 09a4a09

Browse files
[camera] Remove usage of _ambiguate method in example (#6555)
1 parent 32b1f7b commit 09a4a09

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

packages/camera/camera/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.10.0+4
2+
3+
* Removes usage of `_ambiguate` method in example.
4+
* Updates minimum Flutter version to 3.0.
5+
16
## 0.10.0+3
27

38
* Updates code for `no_leading_underscores_for_local_identifiers` lint.

packages/camera/camera/example/lib/main.dart

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
7272
@override
7373
void initState() {
7474
super.initState();
75-
_ambiguate(WidgetsBinding.instance)?.addObserver(this);
75+
WidgetsBinding.instance.addObserver(this);
7676

7777
_flashModeControlRowAnimationController = AnimationController(
7878
duration: const Duration(milliseconds: 300),
@@ -102,7 +102,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
102102

103103
@override
104104
void dispose() {
105-
_ambiguate(WidgetsBinding.instance)?.removeObserver(this);
105+
WidgetsBinding.instance.removeObserver(this);
106106
_flashModeControlRowAnimationController.dispose();
107107
_exposureModeControlRowAnimationController.dispose();
108108
super.dispose();
@@ -585,7 +585,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
585585
}
586586

587587
if (_cameras.isEmpty) {
588-
_ambiguate(SchedulerBinding.instance)?.addPostFrameCallback((_) async {
588+
SchedulerBinding.instance.addPostFrameCallback((_) async {
589589
showInSnackBar('No camera found.');
590590
});
591591
return const Text('None');
@@ -1079,10 +1079,3 @@ Future<void> main() async {
10791079
}
10801080
runApp(const CameraApp());
10811081
}
1082-
1083-
/// This allows a value of type T or T? to be treated as a value of type T?.
1084-
///
1085-
/// We use this so that APIs that have become non-nullable can still be used
1086-
/// with `!` and `?` on the stable branch.
1087-
// TODO(ianh): Remove this once we roll stable in late 2021.
1088-
T? _ambiguate<T>(T? value) => value;

packages/camera/camera/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ publish_to: none
44

55
environment:
66
sdk: ">=2.14.0 <3.0.0"
7-
flutter: ">=2.10.0"
7+
flutter: ">=3.0.0"
88

99
dependencies:
1010
camera:

packages/camera/camera/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ description: A Flutter plugin for controlling the camera. Supports previewing
44
Dart.
55
repository: https://github.com/flutter/plugins/tree/main/packages/camera/camera
66
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
7-
version: 0.10.0+3
7+
version: 0.10.0+4
88

99
environment:
1010
sdk: ">=2.14.0 <3.0.0"
11-
flutter: ">=2.10.0"
11+
flutter: ">=3.0.0"
1212

1313
flutter:
1414
plugin:

0 commit comments

Comments
 (0)