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

chore: updated the painter to have the same UI for each screen size. #1096

Open
wants to merge 1 commit into
base: flutter_app
Choose a base branch
from

Conversation

Jhalakupadhyay
Copy link
Contributor

@Jhalakupadhyay Jhalakupadhyay commented Nov 14, 2024

#1095
I have added the screen Utils property for the width of the screen this will handle the cells size as per the screen size and the draw badge screen UI will remain same for each screen sizes.

WhatsApp Image 2024-11-15 at 00 28 20_a2b78cd1

image

Summary by Sourcery

Enhancements:

  • Implement responsive UI adjustments for the draw badge screen using flutter_screenutil to ensure consistent appearance across different screen sizes.

Copy link

sourcery-ai bot commented Nov 14, 2024

Reviewer's Guide by Sourcery

The changes update the DrawBadgePaint class to make the badge UI consistent across different screen sizes by introducing screen-width-dependent path offsets and adjusting the rotation angle.

Updated class diagram for DrawBadgePaint

classDiagram
    class DrawBadgePaint {
        List~List~bool~~ grid
        Color color
        draw(Canvas canvas, Size size)
    }
    note for DrawBadgePaint "Updated to include screen-width-dependent path offsets and adjusted rotation angle."
    DrawBadgePaint : +double pathOffsetX1
    DrawBadgePaint : +double pathOffsetX2
    DrawBadgePaint : +double pathOffsetX3
    DrawBadgePaint : +const double radians = math.pi / 3
Loading

File-Level Changes

Change Details Files
Introduced screen-width-dependent path offsets for responsive cell sizing
  • Added flutter_screenutil package import for screen size utilities
  • Created three path offset variables using screen width multipliers
  • Updated path drawing coordinates to use the new dynamic offsets
lib/virtualbadge/view/draw_badge_paint.dart
Modified badge rotation angle
  • Changed rotation angle from pi/4 (45 degrees) to pi/3 (60 degrees)
lib/virtualbadge/view/draw_badge_paint.dart

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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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

@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 @Jhalakupadhyay - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider defining the path offset values (0.15, 0.3, 0.15) as named constants with meaningful names to improve code readability and maintainability.
  • Please explain the reasoning behind changing the rotation angle from π/4 to π/3, as this represents a significant visual change not mentioned in the PR description.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

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.

1 participant