defaultFileLocation function

Future<File> defaultFileLocation(
  1. String filename
)

Finds an appropriate place on the user's device to put the file. In this case we are choosing to use the temp directory. This method is using the path_provider package to get that location.

Implementation

Future<File> defaultFileLocation(String filename) async {
  final dir = await getDefaultDir();
  return File(p.join(dir.absolute.path, filename));
}