有没有办法调用本地文件资源管理器并获得选定的目录路径?
发布于 2021-07-10 22:31:12
你可以试试插件filesystem_picker,它支持移动和桌面平台,在最新的2.0+版本中也支持nullsafety
import 'package:filesystem_picker/filesystem_picker.dart';
import 'dart:io';
import 'package:path_provider/path_provider.dart';
Directory rootPath = await getTemporaryDirectory();
String? path = await FilesystemPicker.open(title: 'Save to folder',
context: context,
rootDirectory: rootPath,
fsType: FilesystemType.folder,
pickText: 'Save file to this folder',
folderIconColor: Colors.teal,
);https://stackoverflow.com/questions/54422880
复制相似问题