getTempPath static method

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

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

Implementation

static String? getTempPath({
  String? category,
  String? fileName,
  String? format,
}) {
  return getPath(_tempDir,
      category: category, fileName: fileName, format: format);
}