Skip to content

Commit

Permalink
Feature: Implemented Pedometer Challenge (#360)
Browse files Browse the repository at this point in the history
* adding the pedometer dependency

* adding the activity recognition permission to AndroidManifest file

* adding the NSMotionUsageDescription to Info.plist file

* adding the isPedometerEnabled and numberOfSteps field to alarm model

* adding the isPedometerEnabled and numberOfSteps field to AddOrUpdateAlarmController

* adding the PedometerChallengeTile and formatting the add_or_update_alarm_view file

* adding the pedometer_challenge_view to alarmChallenge views

* adding the pedometer_challenge_tile to addOrUpdateAlarm views

* adding the walk icon to the alarm tiles on home view

* updating the methods of utils due to introduction of pedometer challenge

* writing logic for pedometer challenge in alarm challenge controller

* adding the logic for pedometer challenge to alarm_challenge_view

* updating the alarm_model.g.dart to avoid merge conflicts
  • Loading branch information
superiorsd10 authored Jan 21, 2024
1 parent d39bf1f commit 2ddef64
Show file tree
Hide file tree
Showing 14 changed files with 723 additions and 84 deletions.
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />

<application
tools:replace="android:label"
Expand Down
6 changes: 6 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,11 @@
<true/>
<key>UIStatusBarHidden</key>
<false/>
<key>NSMotionUsageDescription</key>
<string>This application tracks your steps</string>
<key>UIBackgroundModes</key>
<array>
<string>processing</string>
</array>
</dict>
</plist>
10 changes: 10 additions & 0 deletions lib/app/data/models/alarm_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class AlarmModel {
late bool isMathsEnabled;
late bool isShakeEnabled;
late bool isQrEnabled;
late bool isPedometerEnabled;
late int intervalToAlarm;
late bool isActivityEnabled;
late String location;
Expand All @@ -29,6 +30,7 @@ class AlarmModel {
late List<bool> days;
late List<int> weatherTypes;
late int shakeTimes;
late int numberOfSteps;
late int numMathsQuestions;
late int mathsDifficulty;
late String qrValue;
Expand Down Expand Up @@ -74,6 +76,8 @@ class AlarmModel {
required this.shakeTimes,
required this.isQrEnabled,
required this.qrValue,
required this.isPedometerEnabled,
required this.numberOfSteps,
required this.activityInterval,
this.offsetDetails = const {},
required this.mainAlarmTime,
Expand Down Expand Up @@ -136,6 +140,8 @@ class AlarmModel {
qrValue = documentSnapshot['qrValue'];
isShakeEnabled = documentSnapshot['isShakeEnabled'];
shakeTimes = documentSnapshot['shakeTimes'];
isPedometerEnabled = documentSnapshot['isPedometerEnabled'];
numberOfSteps = documentSnapshot['numberOfSteps'];
ringtoneName = documentSnapshot['ringtoneName'];
note = documentSnapshot['note'];
deleteAfterGoesOff = documentSnapshot['deleteAfterGoesOff'];
Expand Down Expand Up @@ -175,6 +181,8 @@ class AlarmModel {
qrValue = alarmData['qrValue'];
isShakeEnabled = alarmData['isShakeEnabled'];
shakeTimes = alarmData['shakeTimes'];
isPedometerEnabled = alarmData['isPedometerEnabled'];
numberOfSteps = alarmData['numberOfSteps'];
label = alarmData['label'];
isOneTime = alarmData['isOneTime'];
ringtoneName = alarmData['ringtoneName'];
Expand Down Expand Up @@ -222,6 +230,8 @@ class AlarmModel {
'qrValue': alarmRecord.qrValue,
'isShakeEnabled': alarmRecord.isShakeEnabled,
'shakeTimes': alarmRecord.shakeTimes,
'isPedometerEnabled': alarmRecord.isPedometerEnabled,
'numberOfSteps': alarmRecord.numberOfSteps,
'snoozeDuration': alarmRecord.snoozeDuration,
'ringtoneName': alarmRecord.ringtoneName,
'note': alarmRecord.note,
Expand Down
Loading

0 comments on commit 2ddef64

Please sign in to comment.