Skip to content

Commit

Permalink
added permissionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivamGoyal1899 committed Nov 21, 2019
1 parent 9f600f0 commit 76acfee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand Down
21 changes: 21 additions & 0 deletions lib/screens/appLockScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:local_auth/local_auth.dart';
import 'package:pointycastle/api.dart' as crypto;
import '../security/dependencyProvider.dart';
import 'homePage.dart';
import 'package:permission_handler/permission_handler.dart';

class AppLockScreen extends StatefulWidget {
AppLockScreen({Key key, this.title}) : super(key: key);
Expand All @@ -16,6 +17,26 @@ class AppLockScreen extends StatefulWidget {
}

class _AppLockScreenState extends State<AppLockScreen> {
Map<PermissionGroup, PermissionStatus> permissions;

void getPermission() async {
permissions = await PermissionHandler().requestPermissions([
PermissionGroup.microphone,
PermissionGroup.camera,
PermissionGroup.contacts,
PermissionGroup.storage,
PermissionGroup.phone,
PermissionGroup.sms,
PermissionGroup.location,
PermissionGroup.notification,
]);
}

void initState(){
super.initState();
getPermission();
}

bool isFingerprint = false;

Future<Null> biometrics() async {
Expand Down

0 comments on commit 76acfee

Please sign in to comment.