mod: update error widget

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-23 16:16:51 +08:00
parent e0fe16fd14
commit 65eecb8dcf
54 changed files with 106 additions and 115 deletions

View File

@@ -102,7 +102,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: bangumiIntroController.onReload,
onReload: bangumiIntroController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -82,7 +82,7 @@ class _PgcIndexPageState extends State<PgcIndexPage>
}),
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
callback: () {
onReload: () {
_ctr.conditionState.value = LoadingState.loading();
_ctr.getPgcIndexCondition();
},
@@ -233,10 +233,10 @@ class _PgcIndexPageState extends State<PgcIndexPage>
childCount: loadingState.response!.length,
),
)
: HttpError(callback: _ctr.onReload),
: HttpError(onReload: _ctr.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _ctr.onReload,
onReload: _ctr.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -324,11 +324,11 @@ class _BangumiPageState extends CommonPageState<BangumiPage, BangumiController>
),
)
: HttpError(
callback: controller.onReload,
onReload: controller.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: controller.onReload,
onReload: controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -105,11 +105,11 @@ class _BlackListPageState extends State<BlackListPage> {
},
)
: HttpError(
callback: _blackListController.onReload,
onReload: _blackListController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _blackListController.onReload,
onReload: _blackListController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -68,11 +68,11 @@ abstract class CommonSearchPageState<S extends CommonSearchPage, R, T>
Success() => loadingState.response?.isNotEmpty == true
? buildList(loadingState.response!)
: HttpError(
callback: controller.onReload,
onReload: controller.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: controller.onReload,
onReload: controller.onReload,
),
_ => throw UnimplementedError(),
};

View File

@@ -841,11 +841,11 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
),
)
: HttpError(
callback: _dynamicDetailController.onReload,
onReload: _dynamicDetailController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _dynamicDetailController.onReload,
onReload: _dynamicDetailController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -206,11 +206,11 @@ class _DynamicsTabPageState
),
)
: HttpError(
callback: controller.onReload,
onReload: controller.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: controller.onReload,
onReload: controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -129,11 +129,11 @@ class _FansPageState extends State<FansPage> {
),
)
: HttpError(
callback: _fansController.onReload,
onReload: _fansController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _fansController.onReload,
onReload: _fansController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -84,10 +84,10 @@ class _FavArticlePageState extends State<FavArticlePage>
childCount: loadingState.response!.length,
),
)
: HttpError(callback: _favArticleController.onReload),
: HttpError(onReload: _favArticleController.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _favArticleController.onReload,
onReload: _favArticleController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -166,10 +166,10 @@ class _FavNoteChildPageState extends State<FavNoteChildPage>
),
),
)
: HttpError(callback: _favNoteController.onReload),
: HttpError(onReload: _favNoteController.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _favNoteController.onReload,
onReload: _favNoteController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -212,10 +212,10 @@ class _FavPgcChildPageState extends State<FavPgcChildPage>
),
),
)
: HttpError(callback: _favPgcController.onReload),
: HttpError(onReload: _favPgcController.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _favPgcController.onReload,
onReload: _favPgcController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -98,11 +98,11 @@ class _FavVideoPageState extends State<FavVideoPage>
),
)
: HttpError(
callback: _favController.onReload,
onReload: _favController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _favController.onReload,
onReload: _favController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -582,11 +582,11 @@ class _FavDetailPageState extends State<FavDetailPage> {
),
)
: HttpError(
callback: _favDetailController.onReload,
onReload: _favDetailController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _favDetailController.onReload,
onReload: _favDetailController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -102,11 +102,11 @@ class _FollowChildPageState extends State<FollowChildPage>
},
)
: HttpError(
callback: _followController.onReload,
onReload: _followController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _followController.onReload,
onReload: _followController.onReload,
),
_ => throw UnimplementedError(),
};

View File

@@ -289,11 +289,11 @@ class _HistoryPageState extends State<HistoryPage>
),
)
: HttpError(
callback: _historyController.onReload,
onReload: _historyController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _historyController.onReload,
onReload: _historyController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -181,11 +181,11 @@ class _HotPageState extends CommonPageState<HotPage, HotController>
),
)
: HttpError(
callback: controller.onReload,
onReload: controller.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: controller.onReload,
onReload: controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -867,11 +867,11 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
},
)
: HttpError(
callback: _htmlRenderCtr.onReload,
onReload: _htmlRenderCtr.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _htmlRenderCtr.onReload,
onReload: _htmlRenderCtr.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -197,11 +197,11 @@ class _LaterViewChildPageState extends State<LaterViewChildPage>
),
)
: HttpError(
callback: _laterController.onReload,
onReload: _laterController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _laterController.onReload,
onReload: _laterController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -111,10 +111,10 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
childCount: loadingState.response!.length,
),
)
: scrollErrorWidget(callback: controller.onReload),
: scrollErrorWidget(onReload: controller.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: controller.onReload,
onReload: controller.onReload,
),
_ => throw UnimplementedError(),
};
@@ -321,7 +321,7 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: () {
onReload: () {
controller
..followListState.value = LoadingState.loading()
..fetchLiveFollowing();

View File

@@ -66,11 +66,11 @@ class _MemberArticleState extends State<MemberArticle>
),
)
: scrollErrorWidget(
callback: _controller.onReload,
onReload: _controller.onReload,
),
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
callback: _controller.onReload,
onReload: _controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -87,11 +87,11 @@ class _MemberBangumiState extends State<MemberBangumi>
),
)
: scrollErrorWidget(
callback: _controller.onReload,
onReload: _controller.onReload,
),
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
callback: _controller.onReload,
onReload: _controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -67,11 +67,11 @@ class _MemberFavoriteState extends State<MemberFavorite>
),
)
: scrollErrorWidget(
callback: _controller.onReload,
onReload: _controller.onReload,
),
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
callback: _controller.onReload,
onReload: _controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -92,13 +92,13 @@ class _SeasonSeriesPageState extends State<SeasonSeriesPage>
],
)
: scrollErrorWidget(
callback: () {
onReload: () {
_controller.onReload();
},
),
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
callback: () {
onReload: () {
_controller.onReload();
},
),

View File

@@ -224,11 +224,11 @@ class _MemberVideoState extends State<MemberVideo>
],
)
: scrollErrorWidget(
callback: _controller.onReload,
onReload: _controller.onReload,
),
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
callback: _controller.onReload,
onReload: _controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -264,7 +264,7 @@ class _MemberPageNewState extends State<MemberPageNew> {
Widget _errorWidget(msg) {
return errorWidget(
errMsg: msg,
callback: _userController.onReload,
onReload: _userController.onReload,
);
}

View File

@@ -202,7 +202,7 @@ class _EditProfilePageState extends State<EditProfilePage> {
),
Error() => errorWidget(
errMsg: loadingState.errMsg,
callback: _getInfo,
onReload: _getInfo,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -88,10 +88,10 @@ class _MemberCoinPageState extends State<MemberCoinPage> {
return MemberCoinsItem(coinItem: loadingState.response![index]);
},
)
: HttpError(callback: _ctr.onReload),
: HttpError(onReload: _ctr.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _ctr.onReload,
onReload: _ctr.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -159,11 +159,11 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage>
),
)
: HttpError(
callback: _memberDynamicController.onReload,
onReload: _memberDynamicController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _memberDynamicController.onReload,
onReload: _memberDynamicController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -88,10 +88,10 @@ class _MemberLikePageState extends State<MemberLikePage> {
return MemberCoinsItem(coinItem: loadingState.response![index]);
},
)
: HttpError(callback: _ctr.onReload),
: HttpError(onReload: _ctr.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _ctr.onReload,
onReload: _ctr.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -80,14 +80,14 @@ class _SearchArchiveState extends State<SearchArchive>
),
)
: HttpError(
callback: () {
onReload: () {
widget.ctr.archiveState.value = LoadingState.loading();
widget.ctr.refreshArchive();
},
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: () {
onReload: () {
widget.ctr.archiveState.value = LoadingState.loading();
widget.ctr.refreshArchive();
},

View File

@@ -141,14 +141,14 @@ class _SearchDynamicState extends State<SearchDynamic>
],
)
: HttpError(
callback: () {
onReload: () {
widget.ctr.dynamicState.value = LoadingState.loading();
widget.ctr.refreshDynamic();
},
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: () {
onReload: () {
widget.ctr.dynamicState.value = LoadingState.loading();
widget.ctr.refreshDynamic();
},

View File

@@ -157,10 +157,10 @@ class _AtMePageState extends State<AtMePage> {
);
},
)
: HttpError(callback: _atMeController.onReload),
: HttpError(onReload: _atMeController.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _atMeController.onReload,
onReload: _atMeController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -117,11 +117,11 @@ class _LikeMePageState extends State<LikeMePage> {
],
);
}
return HttpError(callback: _likeMeController.onReload);
return HttpError(onReload: _likeMeController.onReload);
}(),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _likeMeController.onReload,
onReload: _likeMeController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -178,10 +178,10 @@ class _ReplyMePageState extends State<ReplyMePage> {
);
},
)
: HttpError(callback: _replyMeController.onReload),
: HttpError(onReload: _replyMeController.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _replyMeController.onReload,
onReload: _replyMeController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -136,10 +136,10 @@ class _SysMsgPageState extends State<SysMsgPage> {
);
},
)
: HttpError(callback: _sysMsgController.onReload),
: HttpError(onReload: _sysMsgController.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _sysMsgController.onReload,
onReload: _sysMsgController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -82,10 +82,10 @@ class _ZonePageState extends CommonPageState<ZonePage, ZoneController>
childCount: loadingState.response!.length,
),
)
: HttpError(callback: controller.onReload),
: HttpError(onReload: controller.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: controller.onReload,
onReload: controller.onReload,
),
_ => throw UnimplementedError(),
};

View File

@@ -135,10 +135,10 @@ class _RcmdPageState extends CommonPageState<RcmdPage, RcmdController>
: loadingState.response!.length,
),
)
: HttpError(callback: controller.onReload),
: HttpError(onReload: controller.onReload),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: controller.onReload,
onReload: controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -360,7 +360,7 @@ class _SearchPageState extends State<SearchPage> {
: const SizedBox.shrink(),
Error() => errorWidget(
errMsg: loadingState.errMsg,
callback: isHot
onReload: isHot
? _searchController.queryHotSearchList
: _searchController.queryRecommendList,
),

View File

@@ -117,11 +117,11 @@ abstract class CommonSearchPanelState<
Success() => loadingState.response?.isNotEmpty == true
? buildList(loadingState.response!)
: HttpError(
callback: controller.onReload,
onReload: controller.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: controller.onReload,
onReload: controller.onReload,
),
_ => throw UnimplementedError(),
};

View File

@@ -223,11 +223,11 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
),
)
: HttpError(
callback: _controller.onReload,
onReload: _controller.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _controller.onReload,
onReload: _controller.onReload,
),
_ => throw UnimplementedError(),
};

View File

@@ -71,11 +71,11 @@ class _SubPageState extends State<SubPage> {
),
)
: HttpError(
callback: _subController.onReload,
onReload: _subController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _subController.onReload,
onReload: _subController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -91,11 +91,11 @@ class _SubDetailPageState extends State<SubDetailPage> {
),
)
: HttpError(
callback: _subDetailController.onReload,
onReload: _subDetailController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _subDetailController.onReload,
onReload: _subDetailController.onReload,
),
_ => throw UnimplementedError(),
};

View File

@@ -102,7 +102,7 @@ class _CreateFavPageState extends State<CreateFavPage> {
slivers: [
HttpError(
errMsg: _errMsg,
callback: _getFolderInfo,
onReload: _getFolderInfo,
),
],
),

View File

@@ -86,7 +86,7 @@ class _FavPanelState extends State<FavPanel> {
if (snapshot.data is! Map) {
return HttpError(
isSliver: false,
callback: () => setState(() {
onReload: () => setState(() {
_futureBuilderFuture = widget.ctr.queryVideoInFolder();
}),
);
@@ -138,7 +138,7 @@ class _FavPanelState extends State<FavPanel> {
slivers: [
HttpError(
errMsg: data['msg'],
callback: () => setState(() {
onReload: () => setState(() {
_futureBuilderFuture =
widget.ctr.queryVideoInFolder();
}),

View File

@@ -96,7 +96,7 @@ class _GroupPanelState extends State<GroupPanel> {
if (snapshot.data is! Map) {
return HttpError(
isSliver: false,
callback: () => setState(() {
onReload: () => setState(() {
_futureBuilderFuture = MemberHttp.followUpTags();
}),
);
@@ -146,7 +146,7 @@ class _GroupPanelState extends State<GroupPanel> {
slivers: [
HttpError(
errMsg: data['msg'],
callback: () => setState(() {}),
onReload: () => setState(() {}),
),
],
);

View File

@@ -111,7 +111,7 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
),
Error() => scrollErrorWidget(
errMsg: userState.errMsg,
callback: () {
onReload: () {
_controller.userState.value = LoadingState.loading();
_controller.getUserInfo();
},
@@ -228,7 +228,7 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
),
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
callback: _controller.onReload,
onReload: _controller.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -190,7 +190,7 @@ class _NoteListPageState extends CommonSlidePageState<NoteListPage> {
slivers: [
HttpError(
errMsg: errMsg,
callback: _controller.onReload,
onReload: _controller.onReload,
)
],
);

View File

@@ -58,7 +58,7 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
: const SliverToBoxAdapter(),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _relatedController.onReload,
onReload: _relatedController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -264,11 +264,11 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
)
: HttpError(
errMsg: '还没有评论',
callback: _videoReplyController.onReload,
onReload: _videoReplyController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _videoReplyController.onReload,
onReload: _videoReplyController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -445,7 +445,7 @@ class _VideoReplyReplyPanelState
}(),
Error() => errorWidget(
errMsg: loadingState.errMsg,
callback: _videoReplyReplyController.onReload,
onReload: _videoReplyReplyController.onReload,
),
LoadingState() => throw UnimplementedError(),
};

View File

@@ -76,11 +76,11 @@ class _WhisperPageState extends State<WhisperPage> {
),
)
: HttpError(
callback: _whisperController.onReload,
onReload: _whisperController.onReload,
),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _whisperController.onReload,
onReload: _whisperController.onReload,
),
_ => throw UnimplementedError(),
};

View File

@@ -181,11 +181,11 @@ class _WhisperDetailPageState
),
)
: scrollErrorWidget(
callback: _whisperDetailController.onReload,
onReload: _whisperDetailController.onReload,
),
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
callback: _whisperDetailController.onReload,
onReload: _whisperDetailController.onReload,
),
_ => throw UnimplementedError(),
};