💄 Web article has max width

This commit is contained in:
LittleSheep 2025-07-03 00:39:45 +08:00
parent 46919dec31
commit 2eba871a6d
2 changed files with 62 additions and 52 deletions

View File

@ -51,6 +51,9 @@ class _ArticleDetailContent extends HookConsumerWidget {
); );
return SingleChildScrollView( return SingleChildScrollView(
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 560),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
@ -100,6 +103,8 @@ class _ArticleDetailContent extends HookConsumerWidget {
), ),
], ],
), ),
),
),
); );
} }
} }

View File

@ -126,7 +126,10 @@ class ArticlesScreen extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
return Scaffold( return Scaffold(
appBar: AppBar(title: Text(title ?? 'Articles')), appBar: AppBar(title: Text(title ?? 'Articles')),
body: CustomScrollView( body: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 560),
child: CustomScrollView(
slivers: [ slivers: [
SliverPadding( SliverPadding(
padding: const EdgeInsets.only(top: 8, left: 8, right: 8), padding: const EdgeInsets.only(top: 8, left: 8, right: 8),
@ -137,6 +140,8 @@ class ArticlesScreen extends ConsumerWidget {
), ),
], ],
), ),
),
),
); );
} }
} }