Skip to content

Customizable Time Limits for Alarm Challenges #734

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 11 commits into
base: main
Choose a base branch
from

Conversation

mahendra-918
Copy link
Collaborator

@mahendra-918 mahendra-918 commented Mar 10, 2025

Description

This pull request implements customizable time limits for the challenges in our alarm app. Previously, the challenge duration was fixed (defaulting to 30 seconds). With these changes, users will be able to set their preferred duration via the challenge screen. The update includes modifications to the controller to store the user-defined time limit and changes to the view to let users update it.

Proposed Changes

alarm_challenge_controller.dart
alarm_challenge_view.dart
settings_controller.dart
settings_view.dart

Fixes #732

Screenshots

REC-20250310213646.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

@mahendra-918
Copy link
Collaborator Author

Hi @MarkisDev , @NishantSinghal19 can you please review this PR Thank you

@@ -406,17 +418,13 @@ class AlarmModel {
}

String boolListToString(List<bool> boolList) {
// Rotate the list to start with Sunday
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bring back these comments, helps us keep track of the logic.

@@ -157,7 +155,7 @@ class AlarmChallengeView extends GetView<AlarmChallengeController> {
),
Obx(
() => Icon(
controller.isQrOngoing.value ==
controller.isMathsOngoing.value ==
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have you changed the flag?

}
await Future.delayed(duration ~/ i);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was done like this to keep the timer decreasing smoothly.

void updateTimeLimit(int newLimit) {
challengeTimeLimit.value = newLimit;
if (alarmRecord != null) {
alarmRecord!.challengeTimeLimit = newLimit;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont need challenge time limit in alarm clock if we're moving this control to secure storage. If value is not present, use the default of 30s.

apiKey.text = retrievedAPIKey;
}

// Store the retrieved weather state from the flutter secure storage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add back these comments

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: Implement Customizable Time Limits for Challenges
2 participants