vlambda博客
学习文章列表

Flutter-选择附件,图片,视频。file_picker

仅供参考:

引入插件:

file_picker: ^1.3.8

按照返回值,分了三组:

第二组:返回文件
// Pick a single file directly
File file = await FilePicker.getFile(type: FileType.ANY); // will return a File object directly from the selected file

List<String> allNames = filePaths.keys; // List of all file names
List<String> allPaths = filePaths.values; // List of all paths
String someFilePath = filePaths['fileName']; // Access a file path directly by its name (matching a key)