fix & improve DownloadedPage

This commit is contained in:
wgh136
2024-05-21 14:59:09 +08:00
parent 5ae73bd7c8
commit 1a224114fc
3 changed files with 248 additions and 190 deletions

View File

@@ -92,6 +92,17 @@ class SliverGridDelegateWithFixedHeight extends SliverGridDelegate {
int calcCrossItemsCount(double width) {
int count = 20;
var itemWidth = width / 20;
if(minCrossAxisExtent == 0) {
count = 1;
itemWidth = width;
while(itemWidth > maxCrossAxisExtent) {
count++;
itemWidth = width / count;
}
return count;
}
while (
!(itemWidth > minCrossAxisExtent && itemWidth < maxCrossAxisExtent)) {
count--;