AlarmSettings.fromJson constructor

AlarmSettings.fromJson(
  1. Map<String, dynamic> json
)

Constructs an AlarmSettings instance from the given JSON data.

Implementation

factory AlarmSettings.fromJson(Map<String, dynamic> json) => AlarmSettings(
      id: json['id'] as int,
      dateTime: DateTime.fromMicrosecondsSinceEpoch(json['dateTime'] as int),
      assetAudioPath: json['assetAudioPath'] as String,
      loopAudio: json['loopAudio'] as bool,
      vibrate: json['vibrate'] != null ? json['vibrate'] as bool : true,
      volumeMax: json['volumeMax'] != null ? json['volumeMax'] as bool : true,
      fadeDuration: json['fadeDuration'] as double,
      notificationTitle: json['notificationTitle'] as String?,
      notificationBody: json['notificationBody'] as String?,
      enableNotificationOnKill: json['enableNotificationOnKill'] as bool,
      stopOnNotificationOpen: json['stopOnNotificationOpen'] as bool,
    );