updateCollection method

Future<Collection?> updateCollection(
  1. String collectionId,
  2. String newname,
  3. List<String>? newpermissions,
  4. bool? documentSecurity,
  5. bool? enabled,
)

Implementation

Future<Collection?> updateCollection(String collectionId, String newname,
    List<String>? newpermissions, bool? documentSecurity, bool? enabled) {
  try {
    Future<Collection> result = databases.updateCollection(
        databaseId: config.DATABASEID,
        collectionId: collectionId,
        name: newname,
        permissions: newpermissions,
        documentSecurity: documentSecurity,
        enabled: enabled);
    return result;
  } on AppwriteException catch (e) {
    print(e.toString());
    return Future.value(null);
  }
}