mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-24 11:36:21 +00:00
Fix android permission request
This commit is contained in:
parent
9bc337534c
commit
3d5bce903d
1 changed files with 6 additions and 0 deletions
|
@ -5,6 +5,7 @@ import 'package:cw_core/wallet_base.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cake_wallet/.secrets.g.dart' as secrets;
|
import 'package:cake_wallet/.secrets.g.dart' as secrets;
|
||||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
class OnRamperPage extends BasePage {
|
class OnRamperPage extends BasePage {
|
||||||
OnRamperPage({
|
OnRamperPage({
|
||||||
|
@ -81,6 +82,11 @@ class OnRamperPageBodyState extends State<OnRamperPageBody> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
androidOnPermissionRequest: (_, __, resources) async {
|
androidOnPermissionRequest: (_, __, resources) async {
|
||||||
|
|
||||||
|
if (await Permission.camera.status != PermissionStatus.granted){
|
||||||
|
await Permission.camera.request();
|
||||||
|
}
|
||||||
|
|
||||||
return PermissionRequestResponse(
|
return PermissionRequestResponse(
|
||||||
resources: resources,
|
resources: resources,
|
||||||
action: PermissionRequestResponseAction.GRANT,
|
action: PermissionRequestResponseAction.GRANT,
|
||||||
|
|
Loading…
Reference in a new issue