mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 10:58:40 +00:00
fix #297
This commit is contained in:
parent
5946420fd0
commit
1cc19f7834
1 changed files with 10 additions and 1 deletions
|
|
@ -206,6 +206,10 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
|||
|
||||
FlutterVolumeController.addListener(
|
||||
(volume) async {
|
||||
if (!widget.isVisible) {
|
||||
await deInitVolumeControl();
|
||||
return;
|
||||
}
|
||||
if (startedVolume == null) {
|
||||
startedVolume = volume;
|
||||
return;
|
||||
|
|
@ -221,7 +225,12 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
|||
}
|
||||
if (Platform.isAndroid) {
|
||||
androidVolumeDownSub = FlutterAndroidVolumeKeydown.stream.listen((event) {
|
||||
takePicture();
|
||||
if (widget.isVisible) {
|
||||
takePicture();
|
||||
} else {
|
||||
deInitVolumeControl();
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue