💄 Optimize post detail layout

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

View File

@@ -459,13 +459,12 @@ 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(
color: Theme.of(context).cardTheme.color,
elevation: 8,
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(24), padding: const EdgeInsets.all(24),
@@ -477,9 +476,14 @@ class _PostDetailLargeScreenLayout extends StatelessWidget {
), ),
), ),
), ),
),
Expanded( Expanded(
flex: 2, flex: 2,
child: Stack(
fit: StackFit.expand,
children: [
Material(
color: Theme.of(context).colorScheme.surfaceContainer,
elevation: 8,
child: CustomScrollView( child: CustomScrollView(
slivers: [ slivers: [
SliverToBoxAdapter( SliverToBoxAdapter(
@@ -519,6 +523,24 @@ class _PostDetailLargeScreenLayout extends StatelessWidget {
], ],
), ),
), ),
if (user.value != null)
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(),
),
],
),
),
], ],
); );
} }