-
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
chore: updated the badge view (aspect ratio) #1142
Conversation
Reviewer's Guide by SourceryThis PR updates the aspect ratio of the badge view to 3.2 and centers the badge preview. Class diagram showing the updated badge view structureclassDiagram
class BMBadge {
-DrawBadgeProvider drawProvider
+build()
-handlePanUpdate()
}
class BadgePaint {
-BadgeUtils badgeUtils
-List~List~bool~~ grid
+paint(Canvas, Size)
}
class BadgeUtils {
+getBadgeOffsetBackground(Size)
+getBadgeSize(double, double, Size)
+getCellStartCoordinate(double, double, double, double)
}
BMBadge --> BadgePaint : uses
BadgePaint --> BadgeUtils : uses
State diagram for badge view rendering processstateDiagram-v2
[*] --> CalculateBackground: Start Rendering
CalculateBackground --> CalculateBadgeSize: Get offset and padding
CalculateBadgeSize --> CalculateCellCoordinates: Determine badge dimensions
CalculateCellCoordinates --> DrawBadge: Calculate grid positions
DrawBadge --> [*]: Complete rendering
note right of CalculateBadgeSize: Maintains 3.2 aspect ratio
note right of DrawBadge: Centers badge in view
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: 1 issue found
- 🟢 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.
lib/view/homescreen.dart
Outdated
AnimationTab(), | ||
EffectTab(), | ||
onTap: () { | ||
badgeData.checkAndTransfer( |
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.
issue: Add validation for empty text before calling checkAndTransfer
The previous error handling for empty text fields was removed. Consider adding validation to prevent potential crashes.
e3aef80
to
e888ba4
Compare
92c0f62
to
093c170
Compare
483256e
to
60773d7
Compare
e888ba4
to
60773d7
Compare
#1095
#1108
Summary by Sourcery
Update the badge view to maintain a consistent aspect ratio across different screens and devices.
New Features:
BadgeUtils
to manage badge dimensions and offsets.Enhancements:
Tests: