I want to implement the following design in the flutter.
This is one item of the ListView
children.
Also the text mentioned in the image is dynamic and therefore i don’t want to give static heigh of the main Container
that means the area in the left side that is the green one should automatically fit the second Container
containing the text.
What i am trying to do right now is :
Container(
child: Stack(
children: [
Container(
width: 15,
decoration: BoxDecoration(
color: Colors.green,
borderRadius: BorderRadius.all(
Radius.circular(5))),
),
Positioned(
left: 10,
top: 1,
bottom: 1,
child: Container(
padding: Spacing.padding12,
color: Colors.white,
child: Text(
'Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content'),
))
],
),
),
Thanks in advance
2
Answers
Use boxShadow instead. Something like this:
The following code works like what you want: