我在和颤栗一起工作。我想在ListView的右边添加一个滚动条,就像网页滚动条一样,但是我没有找到任何相关的属性。这个是可能的吗?基本代码已经为您的建议做好准备。
ListView(
scrollDirection: Axis.vertical,
children: <Widget>[
// I will put some HTML code here,
],
),
我有一个滚动控制器,它检查滚动位置是否超过阈值,然后调用函数:
final _scrollController = ScrollController();
final _scrollThreshold = 200.0;
_scrollController.addListener(_onScroll);
void _onScroll() {
final maxScroll = _scrollController.position.maxScrollExtent;
final currentScroll = _scrollController.position.pixels;
if
我是初来乍到的,所以请容忍我。我有一个分页API,这意味着在调用example.com?loaditems.php?page=0时,将加载前10个条目(podcast列表),而example.com?loaditems.php?page=1将从10项加载到20项,以此类推。我希望StreamBuilder先获取页面0,然后当列表到达底部时,它应该加载页面1并显示它。为了检查我是否达到了列表视图中的最后一项,我使用了ScrollController of ListView。
现在我使用的是StreamBuilder,ListView,InheritedWidget。我不确定我是否正确地实现了它,