file connection permission

This commit is contained in:
csf
2022-04-20 22:37:47 +08:00
parent f5160b60b6
commit 7ec398eccb
3 changed files with 57 additions and 52 deletions

View File

@@ -65,10 +65,15 @@ class _ConnectionPageState extends State<ConnectionPage> {
connect(id);
}
void connect(String id, {bool isFileTransfer = false}) {
void connect(String id, {bool isFileTransfer = false}) async {
if (id == '') return;
id = id.replaceAll(' ', '');
if (isFileTransfer) {
if (!await PermissionManager.check("file")) {
if (!await PermissionManager.request("file")) {
return;
}
}
Navigator.push(
context,
MaterialPageRoute(