This is the desired result.
What I have tried:
Container(
height: 60,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: 7,
separatorBuilder: (context, index) => SizedBox(
width: 5,
),
itemBuilder: (context, index) {
if (index == 0) {
return Stack(
clipBehavior: Clip.none,
children: [
Container(
width: 60,
color: Colors.blueAccent,
),
Positioned(
left: 25,
bottom: -25,
child: Container(
child: Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
),
color: Colors.amberAccent,
height: 30,
),
),
],
);
} else {
return Container(
width: 60,
color: Colors.blueAccent,
);
}
},
),
),
This is what it looks like with no horizontal scroll (less than 7 itemcount). This is what it looks like with horizontal scroll.
How to position the text outside of the stack while in front of the other widgets?