flutter 插件path_provider


一个Flutter插件,用于查找文件系统上常用的位置。支持iOS和Android。

添加依赖

dependencies:
  path_provider: ^0.5.0+1

安装

flutter packages get

导入

import 'package:path_provider/path_provider.dart';

实例

Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;

Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;