You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
568 B
23 lines
568 B
import 'package:get/get.dart';
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
import 'dart:io' show Platform;
|
|
|
|
class PermissionController extends GetxController {
|
|
@override
|
|
void onReady() async {
|
|
super.onReady();
|
|
await requestPermissions();
|
|
}
|
|
|
|
Future<void> requestPermissions() async {
|
|
if (Platform.isAndroid || Platform.isIOS) {
|
|
await [
|
|
Permission.microphone,
|
|
Permission.storage,
|
|
Permission.bluetooth,
|
|
Permission.bluetoothConnect,
|
|
Permission.notification,
|
|
].request();
|
|
}
|
|
}
|
|
}
|