Skip to content

Commit

Permalink
recoding app: fix bug out app
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunhThanhDe committed Feb 20, 2024
1 parent 767b1ac commit 6e2da77
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,19 @@ class CameraPageState extends State<CameraPage> with WidgetsBindingObserver {

@override
void initState() {
print("chung initState");
checkUserConnection();
super.initState();
WidgetsBinding.instance.addObserver(this);
}

@override
void dispose() {
print("chung dispose");
super.dispose();
WidgetsBinding.instance.removeObserver(this);
}

@override
void didChangeAppLifecycleState(AppLifecycleState state) {
print(" chung didChangeAppLifecycleState");
super.didChangeAppLifecycleState(state);
if (state == AppLifecycleState.inactive || state == AppLifecycleState.detached) {
return;
Expand Down
6 changes: 3 additions & 3 deletions lib/section/custom_camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class _CustomCameraState extends State<CustomCamera> with WidgetsBindingObserver
return Container();
}
return PopScope(
canPop: false,
canPop: true,
onPopInvoked: (didPop) {
SystemNavigator.pop();
},
Expand All @@ -113,7 +113,7 @@ class _CustomCameraState extends State<CustomCamera> with WidgetsBindingObserver

void captureImage() {
controller!.takePicture().then((value) {
Navigator.pop(context);
// Navigator.pop(context);
widget.onImageCaptured!(value);
});
}
Expand Down Expand Up @@ -453,7 +453,7 @@ class _CustomCameraState extends State<CustomCamera> with WidgetsBindingObserver
} else {
///Stop video recording
controller!.stopVideoRecording().then((value) {
Navigator.pop(context);
// Navigator.pop(context);
widget.onVideoRecorded!(value);
});
_isRecording = false;
Expand Down
1 change: 0 additions & 1 deletion lib/section/image_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class _ImagePageState extends State<ImagePage> {
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
print("chung PopScope");
Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => const SplashScreen()));
},
child: Scaffold(
Expand Down

0 comments on commit 6e2da77

Please sign in to comment.