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

获取数据问题 #4

Open
yangxuy opened this issue Aug 1, 2019 · 1 comment
Open

获取数据问题 #4

yangxuy opened this issue Aug 1, 2019 · 1 comment

Comments

@yangxuy
Copy link

yangxuy commented Aug 1, 2019

我打开你的案例demo直接报错The getter 'length' was called on null. 点进去是这个地方
Scrollbar(
child: SingleChildScrollView(
child: Container(
width: bloc.rectWidth * data.length,(这里的length为null)
),
controller: _controller,
scrollDirection: Axis.horizontal,
))

@yangxuy
Copy link
Author

yangxuy commented Aug 1, 2019

Scrollbar(
child: SingleChildScrollView(
child: Container(
width: bloc.rectWidth * (data?.length ?? 0),(这里做一下这样的处理,就没有报错了)
),
controller: _controller,
scrollDirection: Axis.horizontal,
))

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