Skip to content

fix(di): move workouts overview cubit outside di - #65

Merged
CowboyGH merged 1 commit into
developfrom
fix/move-workouts-cubit-outside-di
Apr 4, 2026
Merged

CowboyGH merged 1 commit into
developfrom
fix/move-workouts-cubit-outside-di

Conversation

@CowboyGH

@CowboyGH CowboyGH commented Apr 4, 2026 •

Copy link
Copy Markdown
Owner

🚀 Summary

Internal refactoring of dependency injection and state management architecture to improve code organization and maintainability. No user-facing features or functionality have been changed.

@CowboyGH CowboyGH self-assigned this Apr 4, 2026
@CowboyGH CowboyGH added type: refactor Code improvements without changing behavior area: logic State management and business logic labels Apr 4, 2026
@coderabbitai

coderabbitai Bot commented Apr 4, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3fbcb4c6-bca9-42c1-9a47-8819f65af891

📥 Commits

Reviewing files that changed from the base of the PR and between 43994f7 and c2c0e13.

📒 Files selected for processing (4)
  • lib/core/di/di.dart
  • lib/features/profile/presentation/pages/profile_page_builder.dart
  • lib/features/profile/presentation/widgets/profile_parameters_section_widget.dart
  • lib/features/workouts/overview/presentation/pages/workouts_overview_page_builder.dart

📝 Walkthrough

Walkthrough

The pull request refactors the dependency injection pattern for WorkoutsOverviewCubit. It removes the global lazy singleton registration of WorkoutsOverviewCubit from the DI setup and shifts to local instantiation within widget builders. The cubit is now created directly in the widgets that use it (ProfilePageBuilder and WorkoutsOverviewPageBuilder) and accessed via context.read() instead of the DI container. Import ordering is adjusted in the DI file for subscription API clients.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 From the singleton's nest, we hop away,
Local cubits now brighten the widget's day,
No more global chains holding us tight,
Scoped providers make dependencies right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: moving WorkoutsOverviewCubit registration from centralized DI setup to local widget providers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/move-workouts-cubit-outside-di

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CowboyGH
CowboyGH merged commit d2037e5 into develop Apr 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: logic State management and business logic type: refactor Code improvements without changing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant