added a custom timer for the alarm challenges#949
Open
raghavgupta000001 wants to merge 1 commit intoCCExtractor:mainfrom
Open
added a custom timer for the alarm challenges#949raghavgupta000001 wants to merge 1 commit intoCCExtractor:mainfrom
raghavgupta000001 wants to merge 1 commit intoCCExtractor:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 What this PR does
This PR introduces a highly requested feature: the ability to set a custom duration for alarm challenges. Alongside this feature, it resolves a critical rendering bottleneck (flickering on emulators) and fixes a background service crash on modern Android versions.
🛠️ Key Changes
1. Custom Challenge Timer Feature
challengeDurationproperty to the IsarAlarmModel(defaulting to 15s).alarmsdatabase table schema viaisar_provider.dartto sync with the new duration state.2. Render Optimization (Flickering Fix)
AlarmChallengeControllertimer was originally ticking every 50ms (for the old linear progress bar). When applied to the new massive text timer, this overloaded the Android emulator's graphics renderer, causing violent black screen flashing/frame drops.timeRemainingthat ticks exactly once per second (Timer.periodic(const Duration(seconds: 1)...).Obxwidgets in the Challenge Views withRepaintBoundaryto strictly isolate UI repaints and eliminate frame drops entirely.3. Android 14 Exact Alarm Permissions
ignoreBatteryOptimizationscheck to silently fail and block alarm creation.<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />and<uses-permission android:name="android.permission.USE_EXACT_ALARM" />toAndroidManifest.xml. Removed the strict battery optimization check inadd_or_update_alarm_view.dartto allow emulator testing.📱 Visuals
Custom_Alarm_Video.mp4
🧪 Testing Performed