💄 Optimize post detail layout

This commit is contained in:
2026-01-12 01:04:03 +08:00
parent 23c11a2fbd
commit bf2844162d

View File

@@ -459,63 +459,85 @@ class _PostDetailLargeScreenLayout extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final user = ref.watch(userInfoProvider);
return Row( return Row(
children: [ children: [
Expanded( Expanded(
flex: 3, flex: 3,
child: Material( child: Center(
color: Theme.of(context).cardTheme.color, child: Padding(
elevation: 8, padding: const EdgeInsets.all(24),
child: Center( child: CloudFileList(
child: Padding( files: post.attachments,
padding: const EdgeInsets.all(24), disableConstraint: true,
child: CloudFileList( padding: EdgeInsets.zero,
files: post.attachments,
disableConstraint: true,
padding: EdgeInsets.zero,
),
), ),
), ),
), ),
), ),
Expanded( Expanded(
flex: 2, flex: 2,
child: CustomScrollView( child: Stack(
slivers: [ fit: StackFit.expand,
SliverToBoxAdapter( children: [
child: Padding( Material(
padding: const EdgeInsets.all(16), color: Theme.of(context).colorScheme.surfaceContainer,
child: Column( elevation: 8,
crossAxisAlignment: CrossAxisAlignment.start, child: CustomScrollView(
children: [ slivers: [
PostHeader( SliverToBoxAdapter(
item: post, child: Padding(
isFullPost: true, padding: const EdgeInsets.all(16),
isCompact: false, child: Column(
renderingPadding: EdgeInsets.zero, crossAxisAlignment: CrossAxisAlignment.start,
children: [
PostHeader(
item: post,
isFullPost: true,
isCompact: false,
renderingPadding: EdgeInsets.zero,
),
const Gap(8),
PostBody(
item: post,
isFullPost: true,
isTextSelectable: true,
renderingPadding: EdgeInsets.zero,
hideAttachments: true,
textScale: post.type == 1 ? 1.2 : 1.1,
),
const Gap(12),
PostActionButtons(
post: post,
renderingPadding: EdgeInsets.zero,
onRefresh: onRefresh,
onUpdate: onUpdate,
),
],
),
), ),
const Gap(8), ),
PostBody( PostRepliesList(postId: postId, maxWidth: 800),
item: post, SliverGap(MediaQuery.of(context).padding.bottom + 80),
isFullPost: true, ],
isTextSelectable: true,
renderingPadding: EdgeInsets.zero,
hideAttachments: true,
textScale: post.type == 1 ? 1.2 : 1.1,
),
const Gap(12),
PostActionButtons(
post: post,
renderingPadding: EdgeInsets.zero,
onRefresh: onRefresh,
onUpdate: onUpdate,
),
],
),
), ),
), ),
PostRepliesList(postId: postId, maxWidth: 800), if (user.value != null)
SliverGap(MediaQuery.of(context).padding.bottom + 80), Positioned(
bottom: 16 + MediaQuery.of(context).padding.bottom,
left: 16,
right: 16,
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 800),
child: PostQuickReply(
parent: post,
onPosted: () {
ref.read(postRepliesProvider(postId).notifier).refresh();
},
),
).center(),
),
], ],
), ),
), ),