From 515af12c226a1ba5b48d2d2181ada67b270d70f4 Mon Sep 17 00:00:00 2001 From: Yu Gao Date: Fri, 10 Jun 2022 11:12:40 +0800 Subject: [PATCH] fix show 4 column when item count equal 3 --- lib/src/drag_sort_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/drag_sort_view.dart b/lib/src/drag_sort_view.dart index 0047998..aae4250 100644 --- a/lib/src/drag_sort_view.dart +++ b/lib/src/drag_sort_view.dart @@ -412,7 +412,7 @@ class DragSortViewState extends State _init(context, padding, margin); } - int column = (_itemCount > 3 ? 3 : _itemCount + 1); + int column = (_itemCount >= 3 ? 3 : _itemCount + 1); int row = ((_itemCount + (_itemCount < 9 ? 1 : 0)) / 3).ceil(); double realWidth = _itemWidth * column + widget.space * (column - 1) + padding.horizontal;