AlarmNotificationSettings class
Customizes alarm notification appearance and behavior.
Use this to define custom titles, bodies, button text, audio, icons, and images for both Android and iOS notifications.
All fields are optional; platform defaults are used for null values.
Platform Differences:
- Android: Supports custom sound assets, drawable icons, and URL-based images via Coil
- iOS: Supports sound assets; URL images are downloaded synchronously
Example:
const settings = AlarmNotificationSettings(
title: 'Morning Alarm',
body: 'Time to wake up!',
stopButtonText: 'Dismiss',
snoozeButtonText: 'Snooze 5 min',
soundAsset: 'assets/sounds/alarm.mp3',
icon: 'ic_alarm',
bigPictureUrl: 'https://example.com/banner.png',
payload: 'custom_data',
);
await AlarmPlus.schedule(
id: 'morning',
time: tomorrow7am,
notificationSettings: settings,
);
Constructors
- AlarmNotificationSettings({String? title, String? body, String? stopButtonText, String? snoozeButtonText, String? soundAsset, String? icon, String? largeIconAsset, String? bigPictureAsset, String? largeIconUrl, String? bigPictureUrl, String? payload, VibrationSettings vibrationSettings = const VibrationSettings(), VolumeSettings volumeSettings = const VolumeSettings()})
-
Creates notification settings for an alarm.
const
-
AlarmNotificationSettings.fromMap(Map<
String, dynamic> map) -
Deserializes notification settings from a map.
factory
Properties
- bigPictureAsset → String?
-
Path to a big picture asset for the notification (e.g. 'assets/images/banner.png')
final
- bigPictureUrl → String?
-
URL to a big picture image for the notification.
final
- body → String?
-
Notification body text (content).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → String?
-
The icon name for Android small icon (e.g. 'ic_notification')
final
- largeIconAsset → String?
-
Path to a large icon asset for the notification (e.g. 'assets/images/alarm.png')
final
- largeIconUrl → String?
-
URL to a large icon image for the notification.
final
- payload → String?
-
Custom payload string for notification interaction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- snoozeButtonText → String?
-
Label for the snooze action button.
final
- soundAsset → String?
-
Path to a custom sound asset (e.g. 'assets/audio/alarm.mp3')
final
- stopButtonText → String?
-
Label for the stop/dismiss action button.
final
- title → String?
-
Notification title (heading).
final
- vibrationSettings → VibrationSettings
-
Configuration for vibration pattern and behavior.
final
- volumeSettings → VolumeSettings
-
Configuration for volume level, fading, and enforcement.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - Serializes notification settings to a map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited