AlarmSettings class

AlarmSettings is a model that contains all the settings to customize and set an alarm.

Annotations

Constructors

AlarmSettings({required int id, required DateTime dateTime, required String assetAudioPath, required NotificationSettings notificationSettings, bool loopAudio = true, bool vibrate = true, double? volume, bool volumeEnforced = false, double fadeDuration = 0.0, bool warningNotificationOnKill = true, bool androidFullScreenIntent = true})
Constructs an instance of AlarmSettings.
const
AlarmSettings.fromJson(Map<String, dynamic> json)
Constructs an AlarmSettings instance from the given JSON data.
factory

Properties

androidFullScreenIntent bool
Whether to turn screen on and display full screen notification when android alarm notification is triggered. Enabled by default.
final
assetAudioPath String
Path to audio asset to be used as the alarm ringtone. Accepted formats:
final
dateTime DateTime
Date and time when the alarm will be triggered.
final
fadeDuration double
Duration, in seconds, over which to fade the alarm ringtone. Set to 0.0 by default, which means no fade.
final
hashCode int
Returns a hash code for this AlarmSettings instance using Jenkins hash function.
no setteroverride
id int
Unique identifier assiocated with the alarm. Cannot be 0 or -1;
final
loopAudio bool
If true, assetAudioPath will repeat indefinitely until alarm is stopped.
final
notificationSettings NotificationSettings
Settings for the notification.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vibrate bool
If true, device will vibrate for 500ms, pause for 500ms and repeat until alarm is stopped.
final
volume double?
Specifies the system volume level to be set at the designated dateTime.
final
volumeEnforced bool
If true, the alarm volume is enforced, automatically resetting to the original alarm volume if the user attempts to adjust it. This prevents the user from lowering the alarm volume. Won't work if app is killed.
final
warningNotificationOnKill bool
Whether to show a warning notification when application is killed by user.
final

Methods

copyWith({int? id, DateTime? dateTime, String? assetAudioPath, NotificationSettings? notificationSettings, bool? loopAudio, bool? vibrate, double? volume, bool? volumeEnforced, double? fadeDuration, String? notificationTitle, String? notificationBody, bool? warningNotificationOnKill, bool? androidFullScreenIntent}) AlarmSettings
Creates a copy of AlarmSettings but with the given fields replaced with the new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this AlarmSettings instance to JSON data.
toString() String
Returns all the properties of AlarmSettings for debug purposes.
override

Operators

operator ==(Object other) bool
Compares two AlarmSettings.
override