Skip to content
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

Daily meditation reminder #132

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

Conversation

Sanat-Jha
Copy link
Collaborator

Related Issue

Closes #131

Type of Change

Put x inside the square bracket to specify what type of change your PR is:

  • New Feature

Description of Change

User can choose to have to a daily reminder of meditation. When this option is turned on, user daily gets a reminder to do a meditation session on the first app run of that day.

Demo

image
image

@@ -1,2 +1,2 @@
// Enum to represent options in the menu
enum TaskOption { deleteAll,showKudos,launchMeditationScreen,toggleTipVisibility,exportToCSV }
enum TaskOption { deleteAll,showKudos,launchMeditationScreen,toggleTipVisibility,exportToCSV,toggleMDR }
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 a comment explaining the variable name so that it is clearly understood by other contributors.

@@ -30,6 +33,8 @@ class _HomeScreenState extends State<HomeScreen> {
List<Task> tasks = [];
Kudos kudos = Kudos(score: 0, history: []);
Tip? tip;
bool MeditationDailyRemider = false;
Copy link
Member

Choose a reason for hiding this comment

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

Please follow Dart camel casing here

}

void _loadMeditationDailyReminderDetails() async {
var _MeditationDailyRremider = await MeditationDailyRemiderStorage.get();
Copy link
Member

Choose a reason for hiding this comment

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

There seems to be an issue with the variable name


void _loadMeditationDailyReminderDetails() async {
var _MeditationDailyRremider = await MeditationDailyRemiderStorage.get();
var _LastDateMeditationReminded = await MeditationDailyRemiderStorage.getLastDate();
Copy link
Member

Choose a reason for hiding this comment

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

Follow camel casing everywhere


}
void _checkMeditationReminder() async {
print(LastDateMeditationReminded);
Copy link
Member

Choose a reason for hiding this comment

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

Please remove pring statements in production

final file = File(path);
await file.writeAsString(csv);

print("File saved at: $path");
Copy link
Member

Choose a reason for hiding this comment

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

Remove this print statement as well



class MeditationDailyRemiderStorage {
static const String _MDRSKey = 'MDRS';
Copy link
Member

Choose a reason for hiding this comment

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

Camel case please!

break;
}
});
}
Copy link
Member

Choose a reason for hiding this comment

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

EOF line required here!

builder: (context) => const MeditationCheckDialog(),
).then((value) {
switch (value) {
case 'yes':
Copy link
Member

Choose a reason for hiding this comment

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

This would be better if implemented using an enum

@Sanat-Jha Sanat-Jha force-pushed the daily-meditation-reminder branch from 376a026 to 6a77e55 Compare January 8, 2025 15:02
@Sanat-Jha
Copy link
Collaborator Author

@pranavkonidena Made all the fixes, please check.

@Sanat-Jha
Copy link
Collaborator Author

@pranavkonidena merge conflicts resolved, please review.

@Akshit517
Copy link
Collaborator

@Sanat-Jha Please resolve merge conflicts

@Sanat-Jha
Copy link
Collaborator Author

@Akshit517 resolved.

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.

[Feat] Daily meditation remider
3 participants