Skip to content

Commit 78a6214

Browse files
committed
chore: Tweak library home layout
1 parent fae61a6 commit 78a6214

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/widgets/start_screen/start_group_implementation.dart

+8-5
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,17 @@ class StartGroupImplementation<T> extends StatelessWidget {
7171
double gapSize,
7272
List items,
7373
) {
74-
final int rows = max(
74+
final int columns = max(
7575
((containerHeight - 32) / (cellSize + gapSize)).floor(),
7676
1,
7777
);
78-
final int maxItems =
79-
min(pow(sqrt(items.length).floor(), 2).floor(), pow(rows, 2).floor());
80-
final int columns = min((maxItems / rows).ceil(), rows);
81-
return Dimensions(rows: rows, columns: columns, count: maxItems);
78+
final int maxItems = min(
79+
pow(sqrt(items.length).floor(), 2).floor(), pow(columns, 2).floor());
80+
final int rows = min((maxItems / columns).ceil(), columns);
81+
82+
final int trueColumns = max(columns, 3);
83+
final int trueMaxItems = trueColumns * rows;
84+
return Dimensions(rows: rows, columns: trueColumns, count: trueMaxItems);
8285
}
8386

8487
static (double, double) finalSizeCalculator(

0 commit comments

Comments
 (0)