问题是您将
ListView内部放置在“列/行”中。异常中的文字很好地说明了错误。
为了避免错误,您需要在
ListView内部提供一个尺寸。
我建议您使用此代码
Expanded来告知水平尺寸(最大可用空间)和
SizedBox(可能是容器)
height:
new Row( children: <Widget>[ Expanded( child: SizedBox( height: 200.0, child: new ListView.builder( scrollDirection: Axis.horizontal, itemCount: products.length, itemBuilder: (BuildContext ctxt, int index) { return new Text(products[index]); }, ), ), ), new IconButton( icon: Icon(Icons.remove_circle), onPressed: () {}, ), ], mainAxisAlignment: MainAxisAlignment.spaceBetween, ),



