existsFile static method

Future<bool> existsFile(
  1. String fileName
)

This method checks if the file with the given fileName exists in the application documents directory and returns a boolean value indicating the result.

Implementation

static Future<bool> existsFile(String fileName) async {
  try {
    return File(await getFilePath(fileName)).exists();
  } catch (e) {
    return false;
  }
}