close method

  1. @override
Future<void> close()
inherited

Close the database, releasing resources.

Also disconnects any active connection.

Once close is called, this connection cannot be used again - a new one must be constructed.

Implementation

@override
Future<void> close() async {
  // Don't close in the middle of the initialization process.
  await isInitialized;
  // Disconnect any active sync connection.
  await disconnect();

  if (!database.closed) {
    // Now we can close the database
    await database.close();

    // If there are paused subscriptionso n the status stream, don't delay
    // closing the database because of that.
    unawaited(statusStreamController.close());
    await _activeGroup.close();
  }
}