createNotificationChannel method

Future<NotificationFailure?> createNotificationChannel({
  1. required String channelId,
  2. required String channelName,
  3. String? channelDescription,
  4. NotificationImportance? importance,
  5. bool? enableVibration,
  6. bool? enableLights,
  7. String? sound,
})

Creates a notification channel. Uses local repository for channel creation.

Implementation

Future<NotificationFailure?> createNotificationChannel({
  required String channelId,
  required String channelName,
  String? channelDescription,
  NotificationImportance? importance,
  bool? enableVibration,
  bool? enableLights,
  String? sound,
}) async {
  if (!_isInitialized) {
    return NotificationFailure.initialization(
      details: 'Notification manager not initialized',
    );
  }

  return _localRepository.createNotificationChannel(
    channelId: channelId,
    channelName: channelName,
    channelDescription: channelDescription,
    importance: importance,
    enableVibration: enableVibration,
    enableLights: enableLights,
    sound: sound,
  );
}