up
This commit is contained in:
@@ -118,24 +118,33 @@ class _FeedScreenState extends ConsumerState<FeedScreen>
|
||||
child: Text('暂无视频', style: TextStyle(color: AppColors.textSecondary)),
|
||||
)
|
||||
else
|
||||
PageView.builder(
|
||||
controller: _pageController,
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: state.items.length,
|
||||
onPageChanged: notifier.onPageChanged,
|
||||
itemBuilder: (context, index) {
|
||||
final item = state.items[index];
|
||||
return FeedVideoPage(
|
||||
key: ValueKey(item.videoId),
|
||||
item: item,
|
||||
slotIndex: notifier.pool.slotOf(index),
|
||||
pool: notifier.pool,
|
||||
isCurrent: index == state.currentIndex,
|
||||
onLike: notifier.toggleLike,
|
||||
onFavorite: notifier.toggleFavorite,
|
||||
onComment: _openComments,
|
||||
);
|
||||
NotificationListener<ScrollNotification>(
|
||||
onNotification: (n) {
|
||||
// 手指开始拖动即静音,避免划动过程中上一个视频仍在出声
|
||||
if (n is ScrollStartNotification && n.dragDetails != null) {
|
||||
notifier.pool.pauseCurrent();
|
||||
}
|
||||
return false;
|
||||
},
|
||||
child: PageView.builder(
|
||||
controller: _pageController,
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: state.items.length,
|
||||
onPageChanged: notifier.onPageChanged,
|
||||
itemBuilder: (context, index) {
|
||||
final item = state.items[index];
|
||||
return FeedVideoPage(
|
||||
key: ValueKey(item.videoId),
|
||||
item: item,
|
||||
slotIndex: notifier.pool.slotOf(index),
|
||||
pool: notifier.pool,
|
||||
isCurrent: index == state.currentIndex,
|
||||
onLike: notifier.toggleLike,
|
||||
onFavorite: notifier.toggleFavorite,
|
||||
onComment: _openComments,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
// 顶部:策略 Tab + 搜索入口
|
||||
|
||||
Reference in New Issue
Block a user