// Author: fengshengxiong
// Date: 2024/5/10
// Description: 本地路径

import 'dart:io';
import 'package:path_provider/path_provider.dart';

class LocalPathUtil {
  /// 获取临时目录
  /// `NSCachesDirectory` on iOS and macOS
  /// `Context.getCacheDir` on Android.
  static Future<Directory> getTemporaryPath() async {
    return await getTemporaryDirectory();
  }

  /// 获取应用支持目录
  /// `NSApplicationSupportDirectory` on iOS and macOS.
  /// The Flutter engine's `PathUtils.getFilesDir` API on Android.
  static Future<Directory> getSupportPath() async {
    return await getApplicationSupportDirectory();
  }

  /// 获取应用文档目录
  /// `NSDocumentDirectory` on iOS and macOS.
  /// The Flutter engine's `PathUtils.getDataDirectory` API on Android.
  static Future<Directory> getDocumentsPath() async {
    return await getApplicationDocumentsDirectory();
  }
}