Skip to content

Commit

Permalink
Add minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
gdelataillade committed Nov 22, 2023
1 parent 6174974 commit eb6a717
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
3 changes: 2 additions & 1 deletion example/lib/screens/edit_alarm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,12 @@ class _ExampleAlarmEditScreenState extends State<ExampleAlarmEditScreen> {
}

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() {
Expand Down

0 comments on commit eb6a717

Please sign in to comment.