getTempFilePath static method

Future<String> getTempFilePath(
  1. String tempFileName
)

This method returns a temporary file path with the given tempFileName in the temporary directory of the device.

Implementation

static Future<String> getTempFilePath(String tempFileName) async {
  final Directory tempDir = await getTemporaryDirectory();
  String tempPath = tempDir.path;
  String tempFilePath = '$tempPath/$tempFileName';

  return tempFilePath;
}