AlarmSettings class
AlarmSettings is a model that contains all the settings to customize and set an alarm.
- Annotations
Constructors
- AlarmSettings.new({required int id, required DateTime dateTime, required String assetAudioPath, required String notificationTitle, required String notificationBody, bool loopAudio = true, bool vibrate = true, double? volume, double fadeDuration = 0.0, bool enableNotificationOnKill = true, bool androidFullScreenIntent = 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
- 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
- enableNotificationOnKill → bool
-
Whether to show a notification when application is killed by user.
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
- notificationBody → String
-
Body of the notification to be shown when alarm is triggered.
final
- notificationTitle → String
-
Title of the notification to be shown when alarm is triggered.
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
Methods
-
copyWith(
{int? id, DateTime? dateTime, String? assetAudioPath, bool? loopAudio, bool? vibrate, double? volume, double? fadeDuration, String? notificationTitle, String? notificationBody, bool? enableNotificationOnKill, 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