Repository navigation
fix: address final mentor code reviews and feedback - #41
Conversation
|
Important Review skippedToo many files! This PR contains 231 files, which is 131 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
| "@executable_path/Frameworks", | ||
| ); | ||
| PRODUCT_BUNDLE_IDENTIFIER = com.example.templateFlutter; | ||
| PRODUCT_BUNDLE_IDENTIFIER = org.aossie.moveYourBody; |
There was a problem hiding this comment.
change bundle identifier to org.aossie.move
| <string>6.0</string> | ||
| <key>CFBundleName</key> | ||
| <string>template_flutter</string> | ||
| <string>move_your_body</string> |
| return DatabaseService(); | ||
| }); | ||
|
|
||
| class DatabaseService { |
There was a problem hiding this comment.
Initialize with Class Annotation ( @ Riverpod) and part generation
| class DatabaseService { | ||
| /// Version of the bundled exercises asset database, Increase this version only when `assets/exercises.db`; | ||
| /// is updated to trigger copying the new database to device storage on app launch. | ||
| static const int exercisesDbVersion = 1; |
| ); | ||
| } | ||
|
|
||
| Future<int> insertUserDb( |
| debugPrint("🚀 Pipeline Phase 2: Initializing static exercises DB..."); | ||
| await DatabaseService.instance.exercisesDatabase; | ||
| await ref.read(databaseServiceProvider).exercisesDatabase; |
There was a problem hiding this comment.
initializing in the wrong way, just ref.read databaseServiceProvider
| } | ||
|
|
||
| Future<void> _initialize() async { | ||
| state = state.copyWith(isLoading: true, errorMessage: null); |
There was a problem hiding this comment.
Remove errorMessage and isLoading from Model, use Riverpod Async Provider to handle
| return HomeState(selectedDate: now, currentWeekDays: days); | ||
| } | ||
|
|
||
| Future<void> _initialize() async { |
There was a problem hiding this comment.
Instead of updating state at every step, build a new state object in memory and update everything at the end so that it is declarative
| isLoading: false, | ||
| ); | ||
| } catch (e) { | ||
| state = state.copyWith(isLoading: false, errorMessage: e.toString()); |
There was a problem hiding this comment.
do not store errors in state, rethrow to UI
| return ExerciseRepository(dbService); | ||
| }); | ||
|
|
||
| class ExerciseRepository { |
There was a problem hiding this comment.
Store model in state with all excercises data to avoid repeated DB calls
|
@M4dhav please review |
Addressed Issues:
Fixes #(issue number) - N/A
Screenshots/Recordings: N/A
Additional Notes:
Addressed all code review feedback and suggestions provided by the mentor in the review Google Doc - link
Checklist
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.