Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

════════ Exception caught by animation library ═════════════════════════════════ The Scrollbar's ScrollController has no ScrollPosition attached. #225

Open
taoli-ax opened this issue Nov 16, 2024 · 0 comments

Comments

@taoli-ax
Copy link

taoli-ax commented Nov 16, 2024

6.4 滚动监听及控制
6.4.1 ScrollController
2. 实例

       @override
        Widget build(BuildContext context) {
          return Scaffold(
            appBar: AppBar(title: Text("滚动控制")),
            body: Scrollbar(
              child: ListView.builder(
                itemCount: 100,
                itemExtent: 50.0, //列表项高度固定时,显式指定高度是一个好习惯(性能消耗小)
                controller: _controller,
                itemBuilder: (context, index) {
                  return ListTile(title: Text("$index"),);
                }
              ),
            ),

Scrollbar里没有绑定controller: _controller 导致异常抛出

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant