fileExists function

bool fileExists(
  1. String filePath
)

Checks whether a file exists.

Implementation

bool fileExists(String filePath) {
  bool result = false;
  try {
    File(filePath).readAsStringSync();
    result = true;
  } catch (e) {
    result = false;
  }
  return result;
}