checkInstance static method

Infospect checkInstance(
  1. Infospect? instance
)

Checks if the Infospect instance is initialized and throws an error

Implementation

static Infospect checkInstance(Infospect? instance) {
  if (instance == null) {
    throw FlutterError.fromParts(<DiagnosticsNode>[
      ErrorSummary('Infospect is not yet initialized'),
      ErrorDescription(
        'This probably indicates that Infospect.instance was used but was not initialized',
      ),
      ErrorHint('To fix this use Infospect.ensureInitialized() at the main'),
    ]);
  }

  return instance;
}