import 'package:permission_handler/permission_handler.dart';

class SCPermissionUtils{
  static Future<bool> checkMicrophonePermission() async {
    // 检查当前权限状态
    var status = await Permission.microphone.status;
    if (status.isDenied) {
      // 请求权限（弹出系统弹窗）
      status = await Permission.microphone.request();
    }
    return status.isGranted;
  }

  static Future<bool> checkPhotosPermission() async {
    // 检查当前权限状态
    var status = await Permission.photos.status;
    if (status.isDenied) {
      // 请求权限（弹出系统弹窗）
      status = await Permission.photos.request();
    }
    return status.isGranted;
  }
}