exists method

Future<bool> exists(
  1. String path
)

Implementation

Future<bool> exists(String path) async {
  try {
    final file = await open(
      path,
      options: const FileOptions(mode: FileMode.read, create: false),
    );
    await file.close();
    return true;
  } catch (_) {
    return false;
  }
}