mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-06-25 09:04:07 +00:00
do not hide camera if app life cycle is inactive
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
4e2b90de33
commit
40b645e803
1 changed files with 4 additions and 3 deletions
|
|
@ -204,7 +204,9 @@ class HomeViewState extends State<HomeView> with WidgetsBindingObserver {
|
|||
if (state == AppLifecycleState.resumed) {
|
||||
if (_offsetRatio < 1 &&
|
||||
!_mainCameraController.isSharePreviewIsShown &&
|
||||
_isViewActive()) {
|
||||
_isViewActive() &&
|
||||
_mainCameraController.cameraController == null &&
|
||||
!_mainCameraController.initCameraStarted) {
|
||||
unawaited(
|
||||
_mainCameraController.selectCamera(
|
||||
_mainCameraController.selectedCameraDetails.cameraId,
|
||||
|
|
@ -212,8 +214,7 @@ class HomeViewState extends State<HomeView> with WidgetsBindingObserver {
|
|||
),
|
||||
);
|
||||
}
|
||||
} else if (state == AppLifecycleState.inactive ||
|
||||
state == AppLifecycleState.paused) {
|
||||
} else if (state == AppLifecycleState.paused) {
|
||||
unawaited(_mainCameraController.closeCamera());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue