Skip to content

Conversation

samruddhi-Rahegaonkar
Copy link
Member

@samruddhi-Rahegaonkar samruddhi-Rahegaonkar commented Aug 22, 2025

Fixes #1419

Changes

  • Removed the outer Container with padding: EdgeInsets.symmetric(vertical: 20.h) → this was pushing buttons downward.
  • Buttons (Save and Transfer) are now directly inside a Row aligned to center.
  • Reduced spacing between buttons: SizedBox(width: 100.w) to SizedBox(width: 40.w).
  • Each button still uses a Container with internal padding (horizontal: 33.w, vertical: 8.h) to keep shape and touch area.
  • Removed unnecessary nesting of Container → Consumer → GestureDetector.
  • Layout is flatter and easier to read/maintain.

Screenshots / Recordings

Screenshot_20250822_074339 Screenshot_20250822_074419

Checklist:

  • No hard coding: I have used resources from constants.dart without hard coding any value.
  • No end of file edits: No modifications done at end of resource files.
  • Code reformatting: I have reformatted code and fixed indentation in every file included in this pull request.
  • Code analyzation: My code passes analyzations run in flutter analyze and tests run in flutter test.

Summary by Sourcery

Remove extra whitespace around Save and Transfer buttons by flattening their layout and adjusting parent container settings.

Bug Fixes:

  • Reduce extra vertical padding around Save and Transfer buttons and decrease inter-button spacing from 100.w to 40.w.

Enhancements:

  • Simplify the widget hierarchy by removing redundant Containers and Consumers and center-align buttons in a single Row.
  • Set the parent Column to mainAxisSize.min and increase the TabBarView height for proper layout adjustment.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @samruddhi-Rahegaonkar, you have reached your weekly rate limit for Sourcery. Please try again later

@samruddhi-Rahegaonkar samruddhi-Rahegaonkar changed the title Issue1419 fix: Reduced the extra white space around save and transfer Aug 22, 2025
Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please test this on different screen sizes and ensure that the buttons do not get moved off-screen.

@hpdang
Copy link
Member

hpdang commented Aug 25, 2025

@nope3472 please review

Copy link
Contributor

@nope3472 nope3472 left a comment

Choose a reason for hiding this comment

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

@samruddhi-Rahegaonkar looks fine on my testing device just confirm on other screen sizes

@samruddhi-Rahegaonkar
Copy link
Member Author

@mariobehling @hpdang @hpdang This is rendering correctly for all screen sizes.

@mariobehling
Copy link
Member

@sourcery-ai review

Copy link
Contributor

sourcery-ai bot commented Sep 1, 2025

Reviewer's Guide

This PR streamlines the HomeScreen button area by removing redundant containers and padding, flattening the layout, and adjusting spacing and sizing to eliminate extra whitespace around the Save and Transfer buttons.

File-Level Changes

Change Details Files
Flattened button container hierarchy and removed extra padding
  • Removed outer Container with vertical padding around the buttons
  • Eliminated unnecessary Container→Consumer→GestureDetector nesting
  • Added mainAxisSize: MainAxisSize.min to the parent Column to prevent excessive expansion
lib/view/homescreen.dart
Simplified button wrappers into direct GestureDetector→Container pairs
  • Replaced multi-layer wrappers for the special-transfer button with a single GestureDetector around a Container
  • Converted Save and Transfer buttons to direct GestureDetector→Container structures without extra parent Containers
  • Consolidated button padding (horizontal: 33.w, vertical: 8.h) for consistent shape and touch area
lib/view/homescreen.dart
Adjusted layout spacing and sizing to reduce whitespace
  • Reduced horizontal gap between Save and Transfer buttons from 100.w to 40.w
  • Increased the TabBarView container height from 250.h to 350.h to maintain overall layout balance
lib/view/homescreen.dart

Assessment against linked issues

Issue Objective Addressed Explanation
#1419 Reduce or remove the large white space above the Save and Transfer buttons in the UI.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • There’s a lot of duplicated styling and onTap logic for the Save/Transfer buttons—consider extracting them into a reusable widget or helper method to make the build method more concise and maintainable.
  • Instead of wrapping Containers with GestureDetector, using Flutter’s built-in Button widgets (ElevatedButton/TextButton) with custom ButtonStyle will improve accessibility and give you consistent ripple effects out of the box.
  • Relying on a fixed height (height: 350.h) for the TabBarView can cause layout issues on different screen sizes—consider using Flexible/Expanded or letting the content size itself dynamically instead.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There’s a lot of duplicated styling and onTap logic for the Save/Transfer buttons—consider extracting them into a reusable widget or helper method to make the build method more concise and maintainable.
- Instead of wrapping Containers with GestureDetector, using Flutter’s built-in Button widgets (ElevatedButton/TextButton) with custom ButtonStyle will improve accessibility and give you consistent ripple effects out of the box.
- Relying on a fixed height (height: 350.h) for the TabBarView can cause layout issues on different screen sizes—consider using Flexible/Expanded or letting the content size itself dynamically instead.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

github-actions bot commented Sep 1, 2025

Build Status

Build successful. APKs to test: https://github.com/fossasia/badgemagic-app/actions/runs/17370904873/artifacts/3895962899.

Screenshots

Android Screenshots
iPhone Screenshots
iPad Screenshots

Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Please address sourcery-ai reviews specifically about screen sizes.

@hpdang
Copy link
Member

hpdang commented Sep 2, 2025

@samruddhi-Rahegaonkar can you get this one ready to merge?

@samruddhi-Rahegaonkar
Copy link
Member Author

@samruddhi-Rahegaonkar can you get this one ready to merge?

yes. by today only.

@samruddhi-Rahegaonkar
Copy link
Member Author

@hpdang @mariobehling the height scales proportionally on different screens (small devices, tablets, large phones).

@samruddhi-Rahegaonkar
Copy link
Member Author

this is ready to merge.

@hpdang
Copy link
Member

hpdang commented Sep 3, 2025

This feature worked for me.

Copy link
Member

@mariobehling mariobehling left a comment

Choose a reason for hiding this comment

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

Ok, merging this, but we need to continuously test this on more different screens.

@mariobehling mariobehling merged commit 9278225 into fossasia:development Sep 4, 2025
9 of 10 checks passed
nope3472 pushed a commit to nope3472/badgemagic-app that referenced this pull request Sep 4, 2025
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.

Reduce white space above Save/Transfer
4 participants