defaultFileLocation function
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));
}