init method

dynamic init({
  1. required String baseUrl,
  2. required String storeKey,
  3. String? authToken,
})

Initializes the Parodia service.

This method sets the base URL, store key, and authentication token for the service. It also initializes the HTTP service and the providers.

Implementation

init({
  required String baseUrl,
  required String storeKey,
  String? authToken,
}) {
  if (_isInitialized == true) {
    return;
  }
  _isInitialized = true;
  _baseUrl = baseUrl;
  _storeKey = storeKey;
  _authToken = authToken;

  _http = ParodiaHTTP(
    baseUrl: _baseUrl!,
    storeKey: _storeKey!,
    authToken: _authToken,
  );

  Providers.init(_http!);
}