@@ -75,7 +75,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
7575 @override
7676 void initState () {
7777 super .initState ();
78- _ambiguate ( WidgetsBinding .instance) ? .addObserver (this );
78+ WidgetsBinding .instance.addObserver (this );
7979
8080 _flashModeControlRowAnimationController = AnimationController (
8181 duration: const Duration (milliseconds: 300 ),
@@ -105,7 +105,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
105105
106106 @override
107107 void dispose () {
108- _ambiguate ( WidgetsBinding .instance) ? .removeObserver (this );
108+ WidgetsBinding .instance.removeObserver (this );
109109 _flashModeControlRowAnimationController.dispose ();
110110 _exposureModeControlRowAnimationController.dispose ();
111111 super .dispose ();
@@ -580,7 +580,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
580580 }
581581
582582 if (_cameras.isEmpty) {
583- _ambiguate ( SchedulerBinding .instance) ? .addPostFrameCallback ((_) async {
583+ SchedulerBinding .instance.addPostFrameCallback ((_) async {
584584 showInSnackBar ('No camera found.' );
585585 });
586586 return const Text ('None' );
@@ -1075,9 +1075,3 @@ Future<void> main() async {
10751075 }
10761076 runApp (const CameraApp ());
10771077}
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