From eb6a717dcc0ad743f175a74952b0e9c4c5434017 Mon Sep 17 00:00:00 2001 From: Gautier de Lataillade <32983806+gdelataillade@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:30:34 +0100 Subject: [PATCH] Add minor adjustments --- README.md | 10 +++++----- example/lib/screens/edit_alarm.dart | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3b461e5..40ff45f 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ This plugin offers a straightforward interface to set and cancel alarms on both Please carefully follow these installation steps. They have been updated for plugin version `3.0.0`. -### [iOS Setup](https://github.com/gdelataillade/alarm/blob/feat/ios-background-fetch/help/INSTALL-IOS.md) -### [Android Setup](https://github.com/gdelataillade/alarm/blob/feat/ios-background-fetch/help/INSTALL-ANDROID.md) +### [iOS Setup](https://github.com/gdelataillade/alarm/blob/main/help/INSTALL-IOS.md) +### [Android Setup](https://github.com/gdelataillade/alarm/blob/main/help/INSTALL-ANDROID.md) ## 📖 How to use @@ -58,9 +58,9 @@ alarmDateTime | `DateTime` | The date and time you want your alarm to ring assetAudio | `String` | The path to you audio asset you want to use as ringtone. Can be a path in your assets folder or a downloaded local file path. loopAudio | `bool` | If true, audio will repeat indefinitely until alarm is stopped. vibrate | `bool` | If true, device will vibrate indefinitely until alarm is stopped. If [loopAudio] is set to false, vibrations will stop when audio ends. -volume | `double` | Sets system volume level (0 to 1) at [dateTime]; reverts on alarm stop. Defaults to current volume if null. +volume | `double` | Sets system volume level (0.0 to 1.0) at [dateTime]; reverts on alarm stop. Defaults to current volume if null. when alarm is stopped. -fadeDuration | `double` | Duration, in seconds, over which to fade the alarm volume. Set to 0 by default, which means no fade. +fadeDuration | `double` | Duration, in seconds, over which to fade the alarm volume. Set to 0.0 by default, which means no fade. notificationTitle | `String` | The title of the notification triggered when alarm rings if app is on background. notificationBody | `String` | The body of the notification. enableNotificationOnKill | `bool` | Whether to show a notification when application is killed to warn the user that the alarm he set may not ring. Enabled by default. @@ -151,7 +151,7 @@ We welcome contributions to this plugin! If you would like to make a change or a These are some features that I have in mind that could be useful: - Use `ffigen` and `jnigen` binding generators to call native code more efficiently instead of using method channels. -- [Notification actions](https://pub.dev/packages/flutter_local_notifications#notification-actions): stop and snooze. +- Notification actions: stop and snooze. - Stop alarm sound when notification is dismissed. - Make alarm ring even if app was terminated. diff --git a/example/lib/screens/edit_alarm.dart b/example/lib/screens/edit_alarm.dart index 69b9f90..cfd954d 100644 --- a/example/lib/screens/edit_alarm.dart +++ b/example/lib/screens/edit_alarm.dart @@ -96,11 +96,12 @@ class _ExampleAlarmEditScreenState extends State { } void saveAlarm() { + if (loading) return; setState(() => loading = true); Alarm.set(alarmSettings: buildAlarmSettings()).then((res) { if (res) Navigator.pop(context, true); + setState(() => loading = false); }); - setState(() => loading = false); } void deleteAlarm() {