From a8ef6aa17a1fd37dc3fc988a0ec3c0f75bfe7a72 Mon Sep 17 00:00:00 2001 From: Gautier de Lataillade <32983806+gdelataillade@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:36:14 +0100 Subject: [PATCH] Fix fromJson method & increment to 2.1.1 --- CHANGELOG.md | 3 +++ example/lib/screens/home.dart | 2 +- example/pubspec.lock | 2 +- lib/model/alarm_settings.dart | 3 ++- pubspec.yaml | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 160da14e..e13676cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2.1.1 +* Fix AlarmSettings.fromJson method with missing [androidFullScreenIntent]. + ## 2.1.0 **Android installation steps were updated.** * [Android] Add parameter [androidFullScreenIntent] that turns screen on when alarm notification is triggered. diff --git a/example/lib/screens/home.dart b/example/lib/screens/home.dart index 4c22572a..a933985e 100644 --- a/example/lib/screens/home.dart +++ b/example/lib/screens/home.dart @@ -71,7 +71,7 @@ class _ExampleAlarmHomeScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: const Text('alarm 2.1.0')), + appBar: AppBar(title: const Text('alarm 2.1.1')), body: SafeArea( child: alarms.isNotEmpty ? ListView.separated( diff --git a/example/pubspec.lock b/example/pubspec.lock index e661ffb7..cbf4d886 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,7 +7,7 @@ packages: path: ".." relative: true source: path - version: "2.1.0" + version: "2.1.1" android_alarm_manager_plus: dependency: transitive description: diff --git a/lib/model/alarm_settings.dart b/lib/model/alarm_settings.dart index b38df7fd..d20612af 100644 --- a/lib/model/alarm_settings.dart +++ b/lib/model/alarm_settings.dart @@ -103,7 +103,8 @@ class AlarmSettings { notificationBody: json['notificationBody'] as String?, enableNotificationOnKill: json['enableNotificationOnKill'] as bool, stopOnNotificationOpen: json['stopOnNotificationOpen'] as bool, - androidFullScreenIntent: json['androidFullScreenIntent'] as bool, + androidFullScreenIntent: + json['androidFullScreenIntent'] as bool? ?? false, ); /// Creates a copy of `AlarmSettings` but with the given fields replaced with diff --git a/pubspec.yaml b/pubspec.yaml index bd06fff2..c1cfbe21 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: alarm description: A simple Flutter alarm manager plugin for both iOS and Android. -version: 2.1.0 +version: 2.1.1 homepage: https://github.com/gdelataillade/alarm environment: