AlarmSettings class
Constructors
AlarmSettings ({required int id , required DateTime dateTime , required String assetAudioPath , bool loopAudio = true , bool vibrate = true , double fadeDuration = 0.0 , String ? notificationTitle , String ? notificationBody , bool enableNotificationOnKill = true })
Model that contains all the settings to customize and set an alarm.
AlarmSettings.fromJson (Map <String , dynamic > json )
Constructs an AlarmSettings
instance from the given JSON data.
factory
Properties
assetAudioPath
→ String
URL or path to audio asset to be used as the alarm ringtone.
For iOS, you need to drag and drop your asset(s) to your Runner
folder
in Xcode and make sure 'Copy items if needed' is checked.
Check out README.md for more informations.
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
The hash code for this object.
no setter inherited
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
vibrate
→ bool
If true, device will vibrate for 500ms, pause for 500ms and repeat until
alarm is stopped.
final
Methods
copyWith ({DateTime ? dateTime , String ? assetAudioPath , bool ? loopAudio , bool ? vibrate , double ? fadeDuration , String ? notificationTitle , String ? notificationBody })
→ 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