ultimate_alarm_clock
ultimate_alarm_clock copied to clipboard
Add Duplicate Button and Functionality to home_view.dart
Description
This PR adds a "Duplicate Alarm" button to the home_view.dart file alongside the existing "Preview Alarm" and "Delete Alarm" buttons. The duplicate button allows users to create a new alarm with the same settings as the selected alarm. The necessary functionality is implemented in the HomeController.
Proposed Changes
AlarmModel (alarm_model.dart):
Added the clone method. HomeController (home_controller.dart):
Added the duplicateAlarm method. HomeView (home_view.dart):
Updated the PopupMenuButton to include the "Duplicate Alarm" option and linked it to the duplicateAlarm method in the HomeController.
Fixes #650
Replace '650' with the issue number which is fixed in this PR
Screenshots
https://github.com/user-attachments/assets/0dc6dcfb-af20-4d83-8116-669faff65172
Checklist
- [x] Tests have been added or updated to cover the changes
- [x] Documentation has been updated to reflect the changes
- [x] Code follows the established coding style guidelines
- [x] All tests are passing
This should ideally only work for non-shared alarms within a single profile only. We can later look into making this possible for shared alarms too.
Ok @MarkisDev , I will look into it. thank you