Skip to content

Commit

Permalink
Fix bug in camera example. (flutter#1958)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetf authored Aug 8, 2019
1 parent b30188e commit 38ff5a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class _CameraExampleHomeState extends State<CameraExampleHome>

@override
void didChangeAppLifecycleState(AppLifecycleState state) {
// App state changed before we got the chance to initialize.
if (controller == null || !controller.value.isInitialized) {
return;
}
if (state == AppLifecycleState.inactive) {
controller?.dispose();
} else if (state == AppLifecycleState.resumed) {
Expand Down

0 comments on commit 38ff5a0

Please sign in to comment.