initialize method

void initialize({
  1. required String mauticBaseUrl,
  2. required String username,
  3. required String password,
})

Implementation

void initialize({
  required String mauticBaseUrl,
  required String username,
  required String password,
}) {
  if (_isInitialized) {
    _logger.warning('MauticService is already initialized.');
    return;
  }

  contactService = ContactService();
  contactService.initialize(mauticBaseUrl, username, password);

  campaignService = CampaignService();
  campaignService.initialize(mauticBaseUrl, username, password);

  fieldsService = FieldsService();
  fieldsService.initialize(mauticBaseUrl, username, password);

  _isInitialized = true;
  _logger.info('MauticService has been initialized.');
}