instance property

ApiService get instance

Returns the singleton initialized by init.

Throws StateError if init has not been called with needInitialGlobalInstance: true (the default).

Implementation

static ApiService get instance {
  final instance = _instance;
  if (instance == null) {
    throw StateError(
      'ApiService has not been initialized. '
      'Call ApiService.init() before accessing ApiService.instance.',
    );
  }
  return instance;
}