bluetooth static method
蓝牙权限
Implementation
static Future<bool> bluetooth({double? width}) async {
String message = '我们申请使用您设备的蓝牙功能,用于发现和链接蓝牙设备';
String error = '请授权蓝牙权限';
if (Platform.isAndroid) {
int version = await getAndroidSdkVersion() ?? 0;
if (version < 31) {
return await request(
permission: Permission.bluetooth,
message: message,
error: error,
width: width,
);
}
}
return await request(
permission: Permission.bluetoothConnect,
message: message,
error: error,
width: width,
);
}