fix: use ceil() for grid height calculation in dashboard menu - #532
Conversation
The height calculation was truncating rows when item count is not divisible by column count, causing content to be cut off. Using ceil() ensures all rows are fully visible.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
Problem
The dashboard menu grid view was cutting off content at the bottom. The height calculation was truncating rows when item count is not divisible by column count.
Solution
Use
.ceil()to round up the row count, ensuring all rows are fully visible.Changes
_buildMenuGridViewindashboard_menu_view.dartto use.ceil()for height calculationTesting
PR Type
Bug fix
Description
Fixed grid height calculation using
.ceil()to prevent content truncationEnsures all menu items are fully visible when count not divisible by columns
Applies to both desktop (3 columns) and mobile (1 column) layouts
Diagram Walkthrough
File Walkthrough
dashboard_menu_view.dart
Apply ceil() to grid row count calculationlib/page/dashboard/views/dashboard_menu_view.dart
_buildMenuGridViewmethod to apply.ceil()to the row countcalculation
(items.length / columnCount) * itemHeightto(items.length / columnCount).ceil() * itemHeightevenly divisible by column count