Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/camera/camera_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Removes usage of `_ambiguate` method in example.

## 0.10.8+8

* Adds pub topics to package metadata.
Expand Down
12 changes: 3 additions & 9 deletions packages/camera/camera_android/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
@override
void initState() {
super.initState();
_ambiguate(WidgetsBinding.instance)?.addObserver(this);
WidgetsBinding.instance.addObserver(this);

_flashModeControlRowAnimationController = AnimationController(
duration: const Duration(milliseconds: 300),
Expand Down Expand Up @@ -105,7 +105,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>

@override
void dispose() {
_ambiguate(WidgetsBinding.instance)?.removeObserver(this);
WidgetsBinding.instance.removeObserver(this);
_flashModeControlRowAnimationController.dispose();
_exposureModeControlRowAnimationController.dispose();
super.dispose();
Expand Down Expand Up @@ -580,7 +580,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}

if (_cameras.isEmpty) {
_ambiguate(SchedulerBinding.instance)?.addPostFrameCallback((_) async {
SchedulerBinding.instance.addPostFrameCallback((_) async {
showInSnackBar('No camera found.');
});
return const Text('None');
Expand Down Expand Up @@ -1075,9 +1075,3 @@ Future<void> 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>(T? value) => value;