AudioServiceConfig constructor Null safety

const AudioServiceConfig(
  1. {bool androidResumeOnClick = true,
  2. String? androidNotificationChannelId,
  3. String androidNotificationChannelName = 'Notifications',
  4. String? androidNotificationChannelDescription,
  5. Color? notificationColor,
  6. String androidNotificationIcon = 'mipmap/ic_launcher',
  7. bool androidShowNotificationBadge = false,
  8. bool androidNotificationClickStartsActivity = true,
  9. bool androidNotificationOngoing = false,
  10. bool androidStopForegroundOnPause = true,
  11. int? artDownscaleWidth,
  12. int? artDownscaleHeight,
  13. Duration fastForwardInterval = const Duration(seconds: 10),
  14. Duration rewindInterval = const Duration(seconds: 10),
  15. bool preloadArtwork = false,
  16. Map<String, dynamic>? androidBrowsableRootExtras}
)

Creates a configuration object.

Implementation

const AudioServiceConfig({
  this.androidResumeOnClick = true,
  this.androidNotificationChannelId,
  this.androidNotificationChannelName = 'Notifications',
  this.androidNotificationChannelDescription,
  this.notificationColor,
  this.androidNotificationIcon = 'mipmap/ic_launcher',
  this.androidShowNotificationBadge = false,
  this.androidNotificationClickStartsActivity = true,
  this.androidNotificationOngoing = false,
  this.androidStopForegroundOnPause = true,
  this.artDownscaleWidth,
  this.artDownscaleHeight,
  this.fastForwardInterval = const Duration(seconds: 10),
  this.rewindInterval = const Duration(seconds: 10),
  this.preloadArtwork = false,
  this.androidBrowsableRootExtras,
})  : assert((artDownscaleWidth != null) == (artDownscaleHeight != null)),
      assert(
        !androidNotificationOngoing || androidStopForegroundOnPause,
        'The androidNotificationOngoing will make no effect with androidStopForegroundOnPause set to false',
      );