the green container should be a static widget the red ones are a FutureBuilder with a singleChildScrollView
Here is my code:
FutureBuilder(
future: getMoodData(),
builder: (BuildContext context, AsyncSnapshot<List<Data>> snapshot) {
if (snapshot.hasData) {
return Row(children: [
Container(height: 150, width: 100, color: Colors.green),
SizedBox(
width: 20,
),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: snapshot.data!
.map((e) => Row(children: [
Container(
height: 150,
child: Text(e.text),
width: 100,
color: Colors.red,
),
SizedBox(
width: 20,
)
]))
.toList(),
))
]);
} else {
return Container();
}
},
),
without the first Row in the FutureBuilder it is working without a problem but with it, I always get an overflow error. Any idea how to fix it?