ScheduleNotifications constructor
ScheduleNotifications(
- String channelId,
- String channelName,
- String channelDescription, {
- String? appIcon,
- TZDateTime? schedule,
- String? title,
- String? body,
- String? payload,
- bool? androidAllowWhileIdle,
- String? icon,
- Importance? importance,
- Priority? priority,
- StyleInformation? styleInformation,
- bool? playSound,
- AndroidNotificationSound? sound,
- bool? enableVibration,
- List<
int> ? vibrationPattern, - String? groupKey,
- bool? setAsGroupSummary,
- GroupAlertBehavior? groupAlertBehavior,
- bool? autoCancel,
- bool? ongoing,
- Color? color,
- AndroidBitmap<
Object> ? largeIcon, - bool? onlyAlertOnce,
- bool? showWhen,
- int? when,
- bool? usesChronometer,
- bool? channelShowBadge,
- bool? showProgress,
- int? maxProgress,
- int? progress,
- bool? indeterminate,
- AndroidNotificationChannelAction? channelAction,
- bool? enableLights,
- Color? ledColor,
- int? ledOnMs,
- int? ledOffMs,
- String? ticker,
- NotificationVisibility? visibility,
- int? timeoutAfter,
- String? category,
- bool? fullScreenIntent,
- String? shortcutId,
- Int32List? additionalFlags,
- String? subText,
- String? tag,
- RepeatInterval? repeatInterval,
- Day? day,
- SelectNotificationCallback? onSelectNotification,
- bool? requestAlertPermission,
- bool? requestSoundPermission,
- bool? requestBadgePermission,
- bool? defaultPresentAlert,
- bool? defaultPresentSound,
- bool? defaultPresentBadge,
- DidReceiveLocalNotificationCallback? onDidReceiveLocalNotification,
- bool? presentAlert,
- bool? presentSound,
- bool? presentBadge,
- String? soundFile,
- int? badgeNumber,
- List<
IOSNotificationAttachment> ? attachments, - String? subtitle,
- String? threadIdentifier,
Implementation
ScheduleNotifications(
this.channelId,
this.channelName,
this.channelDescription, {
String? appIcon,
TZDateTime? schedule,
String? title,
String? body,
String? payload,
bool? androidAllowWhileIdle,
String? icon,
Importance? importance,
Priority? priority,
StyleInformation? styleInformation,
bool? playSound,
AndroidNotificationSound? sound,
bool? enableVibration,
List<int>? vibrationPattern,
String? groupKey,
bool? setAsGroupSummary,
GroupAlertBehavior? groupAlertBehavior,
bool? autoCancel,
bool? ongoing,
Color? color,
AndroidBitmap<Object>? largeIcon,
bool? onlyAlertOnce,
bool? showWhen,
int? when,
bool? usesChronometer,
bool? channelShowBadge,
bool? showProgress,
int? maxProgress,
int? progress,
bool? indeterminate,
AndroidNotificationChannelAction? channelAction,
bool? enableLights,
Color? ledColor,
int? ledOnMs,
int? ledOffMs,
String? ticker,
NotificationVisibility? visibility,
int? timeoutAfter,
String? category,
bool? fullScreenIntent,
String? shortcutId,
Int32List? additionalFlags,
String? subText,
String? tag,
RepeatInterval? repeatInterval,
Day? day,
SelectNotificationCallback? onSelectNotification,
bool? requestAlertPermission,
bool? requestSoundPermission,
bool? requestBadgePermission,
bool? defaultPresentAlert,
bool? defaultPresentSound,
bool? defaultPresentBadge,
DidReceiveLocalNotificationCallback? onDidReceiveLocalNotification,
bool? presentAlert,
bool? presentSound,
bool? presentBadge,
String? soundFile,
int? badgeNumber,
List<IOSNotificationAttachment>? attachments,
String? subtitle,
String? threadIdentifier,
}) {
if (appIcon == null || appIcon.trim().isEmpty) {
// Assign the app's icon.
_appIcon = '@mipmap/ic_launcher';
} else {
_appIcon = appIcon.trim();
}
// Take in parameter values into private variables.
_schedule = schedule;
_title = title ?? '';
_body = body ?? '';
_payload = payload;
_androidAllowWhileIdle = androidAllowWhileIdle ?? false;
_icon = icon;
_importance = importance ?? Importance.defaultImportance;
_priority = priority ?? Priority.defaultPriority;
_styleInformation = styleInformation;
_playSound = playSound; // ?? false;
_sound = sound;
_enableVibration = enableVibration ?? false;
_vibrationPattern = vibrationPattern;
_groupKey = groupKey;
_setAsGroupSummary = setAsGroupSummary ?? false;
_groupAlertBehavior = groupAlertBehavior ?? GroupAlertBehavior.all;
_autoCancel = autoCancel ?? true;
_ongoing = ongoing ?? false;
_color = color;
_largeIcon = largeIcon;
_onlyAlertOnce = onlyAlertOnce ?? false;
_showWhen = showWhen ?? true;
// _when =
_usesChronometer = usesChronometer ?? false;
_channelShowBadge = channelShowBadge ?? true;
_showProgress = showProgress ?? false;
_maxProgress = maxProgress ?? 0;
_progress = progress ?? 0;
_indeterminate = indeterminate ?? false;
_channelAction =
channelAction ?? AndroidNotificationChannelAction.createIfNotExists;
_enableLights = enableLights ?? true;
_ledColor = ledColor ?? const Color.fromARGB(255, 255, 0, 0);
_ledOnMs = ledOnMs ?? 1000;
_ledOffMs = ledOffMs ?? 500;
_ticker = ticker;
_visibility = visibility ?? NotificationVisibility.private;
_timeoutAfter = timeoutAfter;
_category = category;
_fullScreenIntent = fullScreenIntent ?? false;
_shortcutId = shortcutId;
_additionalFlags = additionalFlags;
_subText = subText;
_tag = tag;
_repeatInterval = repeatInterval;
_day = day;
_selectNotificationCallback = onSelectNotification;
_requestAlertPermission = requestAlertPermission ?? true;
_requestSoundPermission = requestSoundPermission ?? true;
_requestBadgePermission = requestBadgePermission ?? true;
_defaultPresentAlert = defaultPresentAlert ?? true;
_defaultPresentSound = defaultPresentSound ?? true;
_defaultPresentBadge = defaultPresentBadge ?? true;
_onDidReceiveLocalNotification = onDidReceiveLocalNotification;
_presentAlert = presentAlert ?? true;
_presentSound = presentSound ?? true;
_presentBadge = presentBadge ?? true;
_soundFile = soundFile;
_badgeNumber = badgeNumber;
_attachments = attachments;
_subtitle = subtitle;
_threadIdentifier = threadIdentifier;
}