✨ Subscribe to category and tags
This commit is contained in:
@@ -83,6 +83,7 @@ class SliverPostList extends HookConsumerWidget {
|
||||
final bool isOpenable;
|
||||
final Function? onRefresh;
|
||||
final Function(SnPost)? onUpdate;
|
||||
final double? maxWidth;
|
||||
|
||||
const SliverPostList({
|
||||
super.key,
|
||||
@@ -98,6 +99,7 @@ class SliverPostList extends HookConsumerWidget {
|
||||
this.isOpenable = true,
|
||||
this.onRefresh,
|
||||
this.onUpdate,
|
||||
this.maxWidth,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -139,6 +141,15 @@ class SliverPostList extends HookConsumerWidget {
|
||||
|
||||
final post = data.items[index];
|
||||
|
||||
if (maxWidth != null) {
|
||||
return Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: maxWidth!),
|
||||
child: _buildPostItem(post),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return _buildPostItem(post);
|
||||
},
|
||||
),
|
||||
|
Reference in New Issue
Block a user