tryFetchFile static method

Future<File?> tryFetchFile(
  1. String filePath
)

Like fetchFile except that this function returns null where a similar call to fetchFile would throw a FileSystemException.

Implementation

static Future<File?> tryFetchFile(String filePath) async {
  try {
    return fetchFile(filePath);
  } on FileSystemException {
    return null;
  }
}