🐛 Fix some bugs in dashboard

This commit is contained in:
2026-01-17 16:02:56 +08:00
parent c36a5eaa73
commit aeea90226a
3 changed files with 33 additions and 18 deletions

View File

@@ -22,7 +22,8 @@ Future<List<SnPost>> featuredPosts(Ref ref) async {
class PostFeaturedList extends HookConsumerWidget {
final bool collapsable;
const PostFeaturedList({super.key, this.collapsable = true});
final double? maxHeight;
const PostFeaturedList({super.key, this.collapsable = true, this.maxHeight});
@override
Widget build(BuildContext context, WidgetRef ref) {
@@ -178,7 +179,7 @@ class PostFeaturedList extends HookConsumerWidget {
error: (error, stack) => Center(child: Text('Error: $error')),
data: (posts) {
return SizedBox(
height: 344,
height: maxHeight == null ? 344 : (maxHeight! - 48),
child: PageView.builder(
controller: pageViewController,
scrollDirection: Axis.horizontal,