I am trying to underline a Container in my Flutter app. So far I achieved a some kind of underling when I used the following code:
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Underline my parent!',
maxLines: 2,
textAlign: TextAlign.center,
),
),
)
],
),
decoration: Border(bottom: BorderSide(color: Colors.grey)),
),
But now I want the underline dash not being from start to end, I want to have space on the start and on the end. If there is some smarter way to underline widgets I would be glad to see it too.
Add a bottom BorderSide
to your container.
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: 1.0, color: Colors.black),
),
),
),