ultimate_alarm_clock icon indicating copy to clipboard operation
ultimate_alarm_clock copied to clipboard

Add Duplicate Button and Functionality to home_view.dart

Open mahendra-918 opened this issue 10 months ago • 2 comments

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

mahendra-918 avatar Jan 28 '25 09:01 mahendra-918

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.

MarkisDev avatar Mar 12 '25 16:03 MarkisDev

Ok @MarkisDev , I will look into it. thank you

mahendra-918 avatar Mar 12 '25 16:03 mahendra-918