AlarmSettings class
Constructors
AlarmSettings ({required int id , required DateTime dateTime , required String assetAudioPath , bool loopAudio = true , bool vibrate = true , bool volumeMax = true , double fadeDuration = 0.0 , String ? notificationTitle , String ? notificationBody , bool enableNotificationOnKill = true , bool stopOnNotificationOpen = true })
Model that contains all the settings to customize and set an alarm.
const
AlarmSettings.fromJson (Map <String , dynamic > json )
Constructs an AlarmSettings
instance from the given JSON data.
factory
Properties
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
enableNotificationOnKill
→ bool
Whether to show a notification when application is killed to warn
the user that the alarms won't ring anymore. Enabled by default.
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 setter override
id
→ int
Unique identifier assiocated with the alarm.
final
loopAudio
→ bool
If true, assetAudioPath will repeat indefinitely until alarm is stopped.
final
notificationBody
→ String ?
Body of the notification to be shown when alarm is triggered.
Must not be null nor empty to show a notification.
final
notificationTitle
→ String ?
Title of the notification to be shown when alarm is triggered.
Must not be null nor empty to show a notification.
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
stopOnNotificationOpen
→ bool
Stops the alarm on opened notification.
final
vibrate
→ bool
If true, device will vibrate for 500ms, pause for 500ms and repeat until
alarm is stopped.
final
volumeMax
→ bool
If true, set system volume to maximum when dateTime is reached
and set it back to its previous value when alarm is stopped.
Else, use current system volume. Enabled by default.
final
Methods
copyWith ({int ? id , DateTime ? dateTime , String ? assetAudioPath , bool ? loopAudio , bool ? vibrate , bool ? volumeMax , double ? fadeDuration , String ? notificationTitle , String ? notificationBody , bool ? enableNotificationOnKill , bool ? stopOnNotificationOpen })
→ 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