opt: common ctr

opt: state

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-11 12:21:42 +08:00
parent 5bff1747e6
commit 574bf861f0
129 changed files with 1065 additions and 1058 deletions

View File

@@ -50,7 +50,7 @@ class LiveAreaChildController
@override
Future<LoadingState<LiveSecondData>> customGetData() =>
LiveHttp.liveSecondList(
pn: currentPage,
pn: page,
isLogin: isLogin,
areaId: areaId,
parentAreaId: parentAreaId,

View File

@@ -74,7 +74,7 @@ class _LiveAreaChildPageState extends State<LiveAreaChildPage>
childCount: 10,
),
),
Success() => SliverMainAxisGroup(
Success(:var response) => SliverMainAxisGroup(
slivers: [
if (_controller.newTags?.isNotEmpty == true)
SliverToBoxAdapter(
@@ -111,7 +111,7 @@ class _LiveAreaChildPageState extends State<LiveAreaChildPage>
),
),
),
loadingState.response?.isNotEmpty == true
response?.isNotEmpty == true
? SliverGrid(
gridDelegate: SliverGridDelegateWithExtentAndRatio(
mainAxisSpacing: StyleString.cardSpace,
@@ -123,13 +123,12 @@ class _LiveAreaChildPageState extends State<LiveAreaChildPage>
),
delegate: SliverChildBuilderDelegate(
(context, index) {
if (index == loadingState.response!.length - 1) {
if (index == response.length - 1) {
_controller.onLoadMore();
}
return LiveCardVApp(
item: loadingState.response![index]);
return LiveCardVApp(item: response[index]);
},
childCount: loadingState.response!.length,
childCount: response!.length,
),
)
: HttpError(
@@ -137,8 +136,8 @@ class _LiveAreaChildPageState extends State<LiveAreaChildPage>
),
],
),
Error() => HttpError(
errMsg: loadingState.errMsg,
Error(:var errMsg) => HttpError(
errMsg: errMsg,
onReload: _controller.onReload,
),
};