Compare commits

..

1 Commits

Author SHA1 Message Date
ynyx631
9636cf62cb Fix the issue of the comic list loading infinitely. Close #584 2025-10-29 19:39:18 +08:00
4 changed files with 9 additions and 9 deletions

View File

@@ -1159,7 +1159,7 @@ class ComicListState extends State<ComicList> {
if (res.data.isEmpty) {
setState(() {
_data[page] = const [];
_maxPage = page;
_maxPage ??= page;
});
} else {
setState(() {
@@ -1282,8 +1282,8 @@ class ComicListState extends State<ComicList> {
],
);
}
if (_data[_page] == null) {
_loadPage(_page);
if (_data[1] == null) {
_loadPage(1);
return Column(
children: [
if (widget.errorLeading != null) widget.errorLeading!,
@@ -1304,7 +1304,7 @@ class ComicListState extends State<ComicList> {
comics: _data.values.expand((element) => element).toList(),
menuBuilder: widget.menuBuilder,
onLastItemBuild: () {
if (_error == null && (_maxPage == null || _page < _maxPage!)) {
if (_error == null && (_maxPage == null || _data.length < _maxPage!)) {
_loadPage(_data.length + 1);
}
},
@@ -1334,7 +1334,7 @@ class ComicListState extends State<ComicList> {
],
).paddingHorizontal(16).paddingVertical(8),
)
else if (_maxPage == null || _page < _maxPage!)
else if (_maxPage == null || _data.length < _maxPage!)
const SliverListLoadingIndicator(),
if (widget.trailingSliver != null) widget.trailingSliver!,
],

View File

@@ -13,7 +13,7 @@ export "widget_utils.dart";
export "context.dart";
class _App {
final version = "1.6.0";
final version = "1.5.3";
bool get isAndroid => Platform.isAndroid;

View File

@@ -1132,4 +1132,4 @@ packages:
version: "0.0.12"
sdks:
dart: ">=3.8.0 <4.0.0"
flutter: ">=3.35.7"
flutter: ">=3.35.5"

View File

@@ -2,11 +2,11 @@ name: venera
description: "A comic app."
publish_to: 'none'
version: 1.6.0+160
version: 1.5.3+153
environment:
sdk: '>=3.8.0 <4.0.0'
flutter: 3.35.7
flutter: 3.35.5
dependencies:
flutter: