AlarmSettings class

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

Annotations
  • @JsonSerializable()

Constructors

AlarmSettings({required int id, required DateTime dateTime, required String assetAudioPath, required VolumeSettings volumeSettings, required NotificationSettings notificationSettings, bool loopAudio = true, bool vibrate = true, bool warningNotificationOnKill = true, bool androidFullScreenIntent = true, bool allowAlarmOverlap = false, bool iOSBackgroundAudio = true})
Constructs an instance of AlarmSettings.
const
AlarmSettings.fromJson(Map<String, dynamic> json)
Constructs an AlarmSettings instance from the given JSON data.
factory
AlarmSettings.fromWire(AlarmSettingsWire wire)
Converts from wire datatype.

Properties

allowAlarmOverlap bool
Whether the alarm should ring if another alarm is already ringing.
final
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
hashCode int
The hash code for this object.
no setterinherited
id int
Unique identifier associated with the alarm. Cannot be 0 or -1.
final
iOSBackgroundAudio bool
iOS apps are killed if they remain inactive in the background. Android does not have this limitation due to native AlarmManager support.
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
volumeSettings VolumeSettings
Settings for the alarm volume.
final
warningNotificationOnKill bool
Whether to show a warning notification when application is killed by user.
final

Methods

copyWith({int? id, DateTime? dateTime, String? assetAudioPath, VolumeSettings? volumeSettings, NotificationSettings? notificationSettings, bool? loopAudio, bool? vibrate, double? volume, bool? volumeEnforced, double? fadeDuration, List<double>? fadeStopTimes, List<double>? fadeStopVolumes, String? notificationTitle, String? notificationBody, bool? warningNotificationOnKill, bool? androidFullScreenIntent, bool? allowAlarmOverlap, bool? iOSBackgroundAudio}) 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 the AlarmSettings instance to a JSON object.
toString() String
A string representation of this object.
inherited
toWire() → AlarmSettingsWire
Converts to wire datatype which is used for host platform communication.

Operators

operator ==(Object other) bool
The equality operator.
inherited