Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-23 16:47:11 +08:00
parent 148e0872b4
commit 418a1e8d39
821 changed files with 29467 additions and 25520 deletions

View File

@@ -18,15 +18,17 @@ class MemberOpusController
final int mid;
String offset = '';
Rx<SpaceTabFilter> type =
const SpaceTabFilter(text: "全部图文", meta: "all", tabName: "图文").obs;
Rx<SpaceTabFilter> type = const SpaceTabFilter(
text: "全部图文",
meta: "all",
tabName: "图文",
).obs;
List<SpaceTabFilter>? filter;
@override
void onInit() {
super.onInit();
filter = Get.find<MemberController>(tag: heroTag)
.tab2
filter = Get.find<MemberController>(tag: heroTag).tab2
?.firstWhereOrNull((e) => e.param == 'contribute')
?.items
?.firstWhereOrNull((e) => e.param == 'opus')
@@ -51,9 +53,9 @@ class MemberOpusController
@override
Future<LoadingState<SpaceOpusData>> customGetData() => MemberHttp.spaceOpus(
hostMid: mid,
page: page,
offset: offset,
type: type.value.meta,
);
hostMid: mid,
page: page,
offset: offset,
type: type.value.meta,
);
}

View File

@@ -85,9 +85,9 @@ class _MemberOpusState extends State<MemberOpus>
..onReload();
},
tileColor: e == _controller.type.value
? Theme.of(context)
.colorScheme
.onInverseSurface
? Theme.of(
context,
).colorScheme.onInverseSurface
: null,
dense: true,
title: Text(
@@ -117,34 +117,36 @@ class _MemberOpusState extends State<MemberOpus>
Widget _buildBody(LoadingState<List<SpaceOpusItemModel>?> loadingState) {
return switch (loadingState) {
Loading() => SliverWaterfallFlow.extent(
maxCrossAxisExtent: Grid.smallCardWidth,
mainAxisSpacing: StyleString.safeSpace,
crossAxisSpacing: StyleString.safeSpace,
children: List.generate(10, (_) => const SpaceOpusSkeleton()),
),
Success(:var response) => response?.isNotEmpty == true
? SliverWaterfallFlow.extent(
maxCrossAxisExtent: Grid.smallCardWidth,
mainAxisSpacing: StyleString.safeSpace,
crossAxisSpacing: StyleString.safeSpace,
lastChildLayoutTypeBuilder: (index) {
if (index == response.length - 1) {
_controller.onLoadMore();
}
return index == response.length
? LastChildLayoutType.foot
: LastChildLayoutType.none;
},
children:
response!.map((item) => SpaceOpusItem(item: item)).toList(),
)
: HttpError(
onReload: _controller.onReload,
),
maxCrossAxisExtent: Grid.smallCardWidth,
mainAxisSpacing: StyleString.safeSpace,
crossAxisSpacing: StyleString.safeSpace,
children: List.generate(10, (_) => const SpaceOpusSkeleton()),
),
Success(:var response) =>
response?.isNotEmpty == true
? SliverWaterfallFlow.extent(
maxCrossAxisExtent: Grid.smallCardWidth,
mainAxisSpacing: StyleString.safeSpace,
crossAxisSpacing: StyleString.safeSpace,
lastChildLayoutTypeBuilder: (index) {
if (index == response.length - 1) {
_controller.onLoadMore();
}
return index == response.length
? LastChildLayoutType.foot
: LastChildLayoutType.none;
},
children: response!
.map((item) => SpaceOpusItem(item: item))
.toList(),
)
: HttpError(
onReload: _controller.onReload,
),
Error(:var errMsg) => HttpError(
errMsg: errMsg,
onReload: _controller.onReload,
),
errMsg: errMsg,
onReload: _controller.onReload,
),
};
}

View File

@@ -68,8 +68,10 @@ class SpaceOpusItem extends StatelessWidget {
),
if (item.content?.isNotEmpty == true)
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 10,
),
child: Text(
item.content!,
maxLines: hasPic ? 4 : 6,