mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59: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:fluffychat/widgets/matrix.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
|
|
||||||
class NewPrivateChat extends StatefulWidget {
|
class NewPrivateChat extends StatefulWidget {
|
||||||
@ -75,10 +76,15 @@ class NewPrivateChatController extends State<NewPrivateChat> {
|
|||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
|
|
||||||
void openScannerAction() => showDialog(
|
void openScannerAction() async {
|
||||||
|
final status = await Permission.camera.request();
|
||||||
|
if (!status.isGranted) return;
|
||||||
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
useRootNavigator: false,
|
||||||
builder: (_) => QrScannerModal(),
|
builder: (_) => QrScannerModal(),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => NewPrivateChatView(this);
|
Widget build(BuildContext context) => NewPrivateChatView(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user