closeCloudDBZone method

Future<void> closeCloudDBZone({
  1. required AGConnectCloudDBZone zone,
})

You can invoke this method to close one Cloud DB zone object opened on the device.

Before using this method to close a Cloud DB zone, ensure that the data write, delete, query, and snapshot listening operations based on the Cloud DB zone have been completed.

After using Cloud DB zone to add, delete, modify, or query data, you can determine whether to close the Cloud DB zone to release resources occupied by Cloud DB zone. Closing Cloud DB zone does not delete underlying data files. If you attempt to close an inexistent Cloud DB zone or repeatedly close Cloud DB zone, the system returns a success message and does not report any exception.

Implementation

Future<void> closeCloudDBZone({
  required AGConnectCloudDBZone zone,
}) async {
  try {
    return await _methodChannel.invokeMethod<void>(
      _MethodConstants.CLOSE_CLOUD_DB_ZONE,
      <String, dynamic>{
        _KeyConstants.ZONE_ID: zone._id,
      },
    );
  } catch (e) {
    throw AGConnectCloudDBException._from(e);
  }
}