throwIfNotInitialised method

void throwIfNotInitialised()

Throws a StateError if the instance is not initialized.

Ensures that the instance is initialized before proceeding with operations that require initialization.

Implementation

void throwIfNotInitialised() {
  if (!isInitialised) {
    throw StateError(
      'The instance must be initialized before calling this method.',
    );
  }
}