I'm trying to add a horizontal listView.builder
on top of another vertical listView.builder
. Both listViews
should have text
on top of both.
This is what I've made so far, only the top horizontal listView.builder
is drawn, when I try to click where the bottom vertical listView.builder
is supposed to be drawn, the app crashes in debug and I get the error: NoSuchMethodError: The getter 'visible' was called on null.
Also, I don't know how to add the two text
fields, so I've left them out.
I have quite a lot of code, if you need to view more of it please do so here
Widget _cryptoWidget() {
return new Container(
child: new Column(
children: <Widget>[
new Flexible(
child: new ListView.builder(
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext context, int index) {
return _listViewFiller();
}
),
),
new Flexible(
child: new RefreshIndicator(
key: refreshKey,
child: new ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: _currencies.length,
itemBuilder: (BuildContext context, int index) {
final int i = index ~/ 2;
final Crypto currency = _currencies[i];
final MaterialColor color = _colors[i % _colors.length];
if (index.isOdd) {
return new Divider();
}
return _getListItemUi(currency, color);
},
),
onRefresh:refreshList,
),
)
],
)
);
}
Best Solution
A very nice example with complete source code here Styled list