loadByPath method
Loads the file at the specified path
.
Returns a Future that completes with the loaded File or null
if the file does not exist.
Implementation
Future<File?> loadByPath(String path) async {
try {
final file = File(path);
if (await file.exists()) {
return file;
}
} catch (_) {
return null;
}
return null;
}