Skip to content

Add Duplicate Button and Functionality to home_view.dart #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mahendra-918
Copy link
Collaborator

@mahendra-918 mahendra-918 commented Jan 28, 2025

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

REC-20250128143739.mp4

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

@MarkisDev
Copy link
Member

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.

@mahendra-918
Copy link
Collaborator Author

mahendra-918 commented Mar 12, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Add Duplicate Button and Functionality to home_view.dart
2 participants