17 lines
467 B
17 lines
467 B
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
class PermissionUtils {
|
|
static Future requestAllPermission() async {
|
|
Map<Permission, PermissionStatus> permission =
|
|
await [Permission.phone, Permission.sms].request();
|
|
if (await Permission.phone.isGranted) {
|
|
BotToast.showText(text: "手机申请通过");
|
|
} else {
|
|
BotToast.showText(text: "手机申请不通过");
|
|
}
|
|
}
|
|
}
|