-
Notifications
You must be signed in to change notification settings - Fork 206
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 draw badge custom paint to have dynamic cell size and adjusted the padding of the UI for the draw badge. #1107
base: flutter_app
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis PR updates the badge drawing functionality by implementing dynamic cell sizing and improving the UI layout. The changes focus on enhancing the visual representation of the badge grid and removing unused utility functions. Class diagram for DrawBadgePaint changesclassDiagram
class DrawBadgePaint {
+List<List<bool>> grid
+void paint(Canvas canvas, Size size)
}
note for DrawBadgePaint "Updated to include dynamic cell sizing and padding adjustments"
DrawBadgePaint : +double cellWidth
DrawBadgePaint : +double cellHeight
DrawBadgePaint : +double pathOffsetX1
DrawBadgePaint : +double pathOffsetX2
DrawBadgePaint : +double pathOffsetX3
DrawBadgePaint : +int paddedRows
DrawBadgePaint : +int paddedCols
File-Level Changes
Possibly linked issues
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: 2 issues 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.
.getDrawViewGrid() | ||
.map((e) => e.map((e) => e ? 1 : 0).toList()) | ||
.toList(); | ||
List<String> hexString = |
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.
suggestion: Consider simplifying the nested conditional logic
The nested ternary operator makes the code harder to read. Consider using if/else statements or extracting this logic into a separate method for better maintainability.
.toList();
List<String> hexString = Converters.convertBitmapToLEDHex(badgeGrid, false);
if (widget.isSavedCard!) {
fileHelper.updateBadgeText(widget.filename!,
3af4d27
to
fb6ed28
Compare
fb6ed28
to
fc520cf
Compare
#1095
Summary by Sourcery
Enhance the draw badge feature by implementing dynamic cell sizes in the custom paint and adjusting the UI padding for better layout. Remove unused utility functions to streamline the codebase.
Enhancements:
Chores: