checkFileExists method

Future<bool> checkFileExists(
  1. String parentUuid,
  2. String name
)

Implementation

Future<bool> checkFileExists(String parentUuid, String name) async {
  final hashed = await crypto.hashFileName(name, masterKeys, email);
  try {
    final res = await api.post(
        '/v3/file/exists', {'parent': parentUuid, 'nameHashed': hashed});
    return res['data']['exists'] == true;
  } catch (e) {
    return false;
  }
}