@@ -75,7 +75,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
75
75
@override
76
76
void initState () {
77
77
super .initState ();
78
- _ambiguate ( WidgetsBinding .instance) ? .addObserver (this );
78
+ WidgetsBinding .instance.addObserver (this );
79
79
80
80
_flashModeControlRowAnimationController = AnimationController (
81
81
duration: const Duration (milliseconds: 300 ),
@@ -105,7 +105,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
105
105
106
106
@override
107
107
void dispose () {
108
- _ambiguate ( WidgetsBinding .instance) ? .removeObserver (this );
108
+ WidgetsBinding .instance.removeObserver (this );
109
109
_flashModeControlRowAnimationController.dispose ();
110
110
_exposureModeControlRowAnimationController.dispose ();
111
111
super .dispose ();
@@ -580,7 +580,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
580
580
}
581
581
582
582
if (_cameras.isEmpty) {
583
- _ambiguate ( SchedulerBinding .instance) ? .addPostFrameCallback ((_) async {
583
+ SchedulerBinding .instance.addPostFrameCallback ((_) async {
584
584
showInSnackBar ('No camera found.' );
585
585
});
586
586
return const Text ('None' );
@@ -1075,9 +1075,3 @@ Future<void> main() async {
1075
1075
}
1076
1076
runApp (const CameraApp ());
1077
1077
}
1078
-
1079
- /// This allows a value of type T or T? to be treated as a value of type T?.
1080
- ///
1081
- /// We use this so that APIs that have become non-nullable can still be used
1082
- /// with `!` and `?` on the stable branch.
1083
- T ? _ambiguate <T >(T ? value) => value;
0 commit comments