mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-23 20:49:26 +01:00
fix: QR Scanner permission
This commit is contained in:
parent
14586297dc
commit
d29729c27c
@ -6,6 +6,7 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:vrouter/vrouter.dart';
|
||||
|
||||
class NewPrivateChat extends StatefulWidget {
|
||||
@ -75,10 +76,15 @@ class NewPrivateChatController extends State<NewPrivateChat> {
|
||||
context,
|
||||
);
|
||||
|
||||
void openScannerAction() => showDialog(
|
||||
context: context,
|
||||
builder: (_) => QrScannerModal(),
|
||||
);
|
||||
void openScannerAction() async {
|
||||
final status = await Permission.camera.request();
|
||||
if (!status.isGranted) return;
|
||||
await showDialog(
|
||||
context: context,
|
||||
useRootNavigator: false,
|
||||
builder: (_) => QrScannerModal(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => NewPrivateChatView(this);
|
||||
|
Loading…
Reference in New Issue
Block a user