Skip to content

Commit 0c8c910

Browse files
committed
fix(弹幕滚动)
1 parent 97bbc1d commit 0c8c910

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/modules/live_play/widgets/danmaku_list_view.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ class DanmakuListViewState extends State<DanmakuListView> {
161161
}
162162
}
163163
}
164+
if (notification.direction == ScrollDirection.reverse || notification.direction == ScrollDirection.idle) {
165+
final distanceToBottom = position.maxScrollExtent - position.pixels;
166+
if (distanceToBottom <= 20) {
167+
if (!_autoScrollEnabled) {
168+
setState(() {
169+
_autoScrollEnabled = true;
170+
userScrolling = false;
171+
});
172+
}
173+
}
174+
}
164175
}
165176

166177
@override

0 commit comments

Comments
 (0)