getTemporaryDirectory static method

Future<Directory> getTemporaryDirectory()

Retrieve the path of your operating system's temporary directory. Support Android and iOS only for now.

Implementation

static Future<Directory> getTemporaryDirectory() async {
  final String? path =
      await _methodChannel.invokeMethod('getTemporaryDirectory');
  if (path == null) {
    throw Exception('Unable to get temporary directory');
  }
  return Directory(path);
}