configure method

Future<void> configure({
  1. required NotificationConfig config,
  2. bool autoInitialize = true,
})

Initialize notification system with a specific provider

config - Configuration for the notification provider autoInitialize - Whether to automatically call initialize() on the service

Implementation

Future<void> configure({
  required NotificationConfig config,
  bool autoInitialize = true,
}) async {
  // Dispose existing service if any
  if (_currentService != null) {
    await _currentService!.dispose();
  }

  // Create new service based on provider type
  _currentService = _createService(config);
  _currentConfig = config;

  if (autoInitialize) {
    await _currentService!.initialize();
  }
}