Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-27 20:54:41 +08:00
parent 25acf3a9bb
commit b51c646415
227 changed files with 768 additions and 764 deletions

View File

@@ -74,8 +74,8 @@ class PgcController
PgcHttp.pgcTimeline(types: 1, before: 6, after: 6),
PgcHttp.pgcTimeline(types: 4, before: 6, after: 6),
]);
var list1 = res.first.dataOrNull;
var list2 = res[1].dataOrNull;
final list1 = res.first.dataOrNull;
final list2 = res[1].dataOrNull;
if (list1 != null &&
list2 != null &&
list1.isNotEmpty &&
@@ -83,10 +83,8 @@ class PgcController
for (var i = 0; i < list1.length; i++) {
list1[i].addAll(list2[i]);
}
} else {
list1 ??= list2;
}
timelineState.value = Success(list1);
timelineState.value = Success(list1 ?? list2);
}
// 我的订阅
@@ -97,7 +95,7 @@ class PgcController
return;
}
followLoading = true;
var res = await FavHttp.favPgc(
final res = await FavHttp.favPgc(
type: tabType == HomeTabType.bangumi ? 1 : 2,
pn: followPage,
);

View File

@@ -83,7 +83,7 @@ class _PgcPageState extends CommonPageState<PgcPage, PgcController>
LoadingState<List<TimelineResult>?> loadingState,
) => switch (loadingState) {
Loading() => loadingWidget,
Success(:var response) =>
Success(:final response) =>
response != null && response.isNotEmpty
? Builder(
builder: (context) {
@@ -189,7 +189,7 @@ class _PgcPageState extends CommonPageState<PgcPage, PgcController>
},
)
: const SizedBox.shrink(),
Error(:var errMsg) => GestureDetector(
Error(:final errMsg) => GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: controller.queryPgcTimeline,
child: Container(
@@ -310,7 +310,7 @@ class _PgcPageState extends CommonPageState<PgcPage, PgcController>
Widget _buildRcmdBody(LoadingState<List<PgcIndexItem>?> loadingState) {
return switch (loadingState) {
Loading() => const SliverToBoxAdapter(),
Success(:var response) =>
Success(:final response) =>
response != null && response.isNotEmpty
? SliverGrid.builder(
gridDelegate: gridDelegate,
@@ -323,7 +323,7 @@ class _PgcPageState extends CommonPageState<PgcPage, PgcController>
itemCount: response.length,
)
: HttpError(onReload: controller.onReload),
Error(:var errMsg) => HttpError(
Error(:final errMsg) => HttpError(
errMsg: errMsg,
onReload: controller.onReload,
),
@@ -397,7 +397,7 @@ class _PgcPageState extends CommonPageState<PgcPage, PgcController>
Widget _buildFollowBody(LoadingState<List<FavPgcItemModel>?> loadingState) {
return switch (loadingState) {
Loading() => loadingWidget,
Success(:var response) =>
Success(:final response) =>
response != null && response.isNotEmpty
? ListView.builder(
controller: controller.followController,
@@ -427,7 +427,7 @@ class _PgcPageState extends CommonPageState<PgcPage, PgcController>
'还没有${widget.tabType == HomeTabType.bangumi ? '追番' : '追剧'}',
),
),
Error(:var errMsg) => Container(
Error(:final errMsg) => Container(
padding: const EdgeInsets.symmetric(horizontal: 16),
alignment: Alignment.center,
child: Text(