Reputation: 1519
I am using container with Text widget inside, I want container to fit the text widget, not to expand to maximum. If you know how can I do that pls tell me.
This is my code:
Container(
height: MediaQuery.of(context).size.height * 0.07,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1),
borderRadius:
BorderRadius.all(Radius.circular(2.0))),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 10),
child: widgets[index],
),
IconButton(
icon: Icon(
Icons.close,
size: 20,
color: Colors.grey,
),
onPressed: () => {
setState(() {
widgets.remove(widgets[index]);
}),
})
],
),
);
Upvotes: 0
Views: 240