getAppDocPath static method

String? getAppDocPath({
  1. String? category,
  2. String? fileName,
  3. String? format,
})

get Application Documents Directory file path. fileName 文件名 format 文件格式,如果文件名包含格式,则不需要 category 分类,例如:Download,Pictures, Music等等 String path = DirectoryUtil.getAppDocPath(category: 'Pictures', fileName: 'demo.png'); String path = DirectoryUtil.getAppDocPath(category: 'Pictures', fileName: 'demo', format: 'png'); Android: /data/user/0/com.thl.flustars_example/app_flutter/Pictures/demo.png iOS: xxx;

Implementation

static String? getAppDocPath({
  String? category,
  String? fileName,
  String? format,
}) {
  return getPath(_appDocDir,
      category: category, fileName: fileName, format: format);
}