-
Notifications
You must be signed in to change notification settings - Fork 213
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
feat: Added the Aspect ratio in the badge UI and updated the custom painter for the badge UI. #1147
Conversation
Reviewer's Guide by SourceryThis pull request introduces two main changes: the addition of aspect ratio to the badge UI and an update to the custom painter for the badge UI. The aspect ratio ensures the badge maintains its proportions across different screen sizes. The custom painter update improves the drawing logic for the badge, enhancing its visual representation by drawing a rectangular border around the badge and correctly positioning and sizing the cells within the badge. Sequence diagram for badge painting processsequenceDiagram
participant BP as BadgePaint
participant BU as BadgeUtils
participant C as Canvas
BP->>BU: getBadgeOffsetBackground(size)
BU-->>BP: offsetBackground
BP->>BU: getBadgeSize(offsetHeight, offsetWidth, size)
BU-->>BP: badgeSize
BP->>C: drawRRect(gridRect, rectPaint)
BP->>BU: getCellStartCoordinate(offsetWidth, offsetHeight, badgeWidth, badgeHeight)
BU-->>BP: cellStartCoordinate
loop For each cell in grid
BP->>C: save()
BP->>C: translate()
BP->>C: rotate()
BP->>C: drawRect()
BP->>C: restore()
end
Class diagram showing the updated badge UI componentsclassDiagram
class BadgeUtils {
+getBadgeOffsetBackground(Size size) MapEntry~double, double~
+getBadgeSize(double offsetHeight, double offsetWidth, Size size) MapEntry~double, double~
+getCellStartCoordinate(double offsetWidth, double offsetHeight, double badgeWidth, double badgeHeight) MapEntry~double, double~
}
class BadgePaint {
-BadgeUtils badgeUtils
-List~List~bool~~ grid
+paint(Canvas canvas, Size size) void
+shouldRepaint(CustomPainter oldDelegate) bool
}
class BMBadge {
+Widget build(BuildContext context)
}
BadgePaint --> BadgeUtils : uses
BMBadge --> BadgePaint : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this 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 and they look great!
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
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
#1095
#1108
Summary by Sourcery
Update the badge UI to include aspect ratio and update the custom painter.
New Features:
Tests: