💄 Better scrolling

This commit is contained in:
2024-05-29 20:13:53 +08:00
parent d4cbabeb31
commit 5f06fc4f9d
6 changed files with 130 additions and 186 deletions

View File

@ -7,7 +7,6 @@ import 'package:solian/widgets/posts/post_action.dart';
import 'package:solian/widgets/posts/post_item.dart';
class PostListWidget extends StatelessWidget {
final bool shrinkWrap;
final bool isShowEmbed;
final bool isClickable;
final bool isNestedClickable;
@ -16,7 +15,6 @@ class PostListWidget extends StatelessWidget {
const PostListWidget({
super.key,
required this.controller,
this.shrinkWrap = false,
this.isShowEmbed = true,
this.isClickable = true,
this.isNestedClickable = true,
@ -24,8 +22,7 @@ class PostListWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return PagedListView<int, Post>.separated(
shrinkWrap: shrinkWrap,
return PagedSliverList<int, Post>.separated(
pagingController: controller,
builderDelegate: PagedChildBuilderDelegate<Post>(
itemBuilder: (context, item, index) {

View File

@ -8,12 +8,10 @@ import 'package:solian/widgets/posts/post_list.dart';
class PostReplyList extends StatefulWidget {
final Post item;
final bool shrinkWrap;
const PostReplyList({
super.key,
required this.item,
this.shrinkWrap = false,
});
@override
@ -55,7 +53,6 @@ class _PostReplyListState extends State<PostReplyList> {
Widget build(BuildContext context) {
return PostListWidget(
isShowEmbed: false,
shrinkWrap: widget.shrinkWrap,
controller: _pagingController,
);
}
@ -76,8 +73,8 @@ class PostReplyListPopup extends StatelessWidget {
style: Theme.of(context).textTheme.headlineSmall,
).paddingOnly(left: 24, right: 24, top: 32, bottom: 16),
Expanded(
child: PostReplyList(
item: item,
child: CustomScrollView(
slivers: [PostReplyList(item: item)],
),
),
],