Skip to content

fix: refactor duplicated Card widget in PowerSource screen#3186

Merged
marcnause merged 1 commit into
fossasia:flutterfrom
rahul31124:refactor_power_source
Apr 19, 2026
Merged

fix: refactor duplicated Card widget in PowerSource screen#3186
marcnause merged 1 commit into
fossasia:flutterfrom
rahul31124:refactor_power_source

Conversation

@rahul31124

Copy link
Copy Markdown
Member

Fixes #3185

Changes

  • Refactored duplicated Card widget code in the PowerSource screen.
  • Created a reusable _buildPowerCard widget to avoid code duplication.
  • Replaced the four repeated card implementations with calls to the reusable widget.
  • Improved code readability and maintainability without changing existing functionality.
  • Reduced file size from 738 lines to 462 lines.

Screenshots / Recordings

Screenshot_20260418_181157

Checklist:

  • No hard coding: I have used values from constants.dart or localization files instead of hard-coded values.
  • No end of file edits: No modifications done at end of resource files.
  • Code reformatting: I have formatted the code using dart format or the IDE formatter.
  • Code analysis: My code passes checks run in flutter analyze and tests run in flutter test.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @rahul31124, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@rahul31124 rahul31124 requested a review from marcnause April 18, 2026 13:39
@github-actions

Copy link
Copy Markdown
Contributor

Build Status

Build successful. APKs to test: https://github.com/fossasia/pslab-app/actions/runs/24629651450/artifacts/6518439720.

Screenshots

Android Screenshots
iPhone Screenshots
iPad Screenshots

@marcnause marcnause force-pushed the refactor_power_source branch from d7b4e82 to 86457f2 Compare April 19, 2026 15:19
@marcnause marcnause merged commit d7b378d into fossasia:flutter Apr 19, 2026
13 of 14 checks passed
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.

Refactor duplicated Card widget in PowerSource screen

2 participants