mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 13:08:42 +00:00
fix #70
This commit is contained in:
parent
672a8cff01
commit
e9c56425ee
2 changed files with 12 additions and 10 deletions
|
|
@ -15,7 +15,8 @@ Future<bool> checkPermissions() async {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!await Permission.microphone.isGranted) {
|
if (!await Permission.microphone.isGranted) {
|
||||||
return false;
|
// microphone is only needed when
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -25,17 +26,17 @@ class PermissionHandlerViewState extends State<PermissionHandlerView> {
|
||||||
// You can request multiple permissions at once.
|
// You can request multiple permissions at once.
|
||||||
Map<Permission, PermissionStatus> statuses = await [
|
Map<Permission, PermissionStatus> statuses = await [
|
||||||
Permission.camera,
|
Permission.camera,
|
||||||
Permission.microphone,
|
// Permission.microphone,
|
||||||
Permission.notification
|
Permission.notification
|
||||||
].request();
|
].request();
|
||||||
|
|
||||||
if (statuses[Permission.microphone]!.isPermanentlyDenied) {
|
// if (statuses[Permission.microphone]!.isPermanentlyDenied) {
|
||||||
openAppSettings();
|
// openAppSettings();
|
||||||
// setState(() {});
|
// // setState(() {});
|
||||||
} else {
|
// } else {
|
||||||
// if (statuses[Permission.microphone]!.isDenied) {
|
// // if (statuses[Permission.microphone]!.isDenied) {
|
||||||
// }
|
// // }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (statuses[Permission.camera]!.isPermanentlyDenied) {
|
if (statuses[Permission.camera]!.isPermanentlyDenied) {
|
||||||
openAppSettings();
|
openAppSettings();
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,8 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
|
||||||
setState(() {
|
setState(() {
|
||||||
isZoomAble = false;
|
isZoomAble = false;
|
||||||
});
|
});
|
||||||
controller = CameraController(gCameras[sCameraId], ResolutionPreset.high);
|
controller = CameraController(gCameras[sCameraId], ResolutionPreset.high,
|
||||||
|
enableAudio: false);
|
||||||
controller.initialize().then((_) async {
|
controller.initialize().then((_) async {
|
||||||
if (!mounted) {
|
if (!mounted) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue