you can also done like this
--- separate your condition using (Ternary conditional operator) :
n==1? Column(
children: [
SizedBox(
child: TextButton(
child: Image.asset('images/a.jpg'),
),
),
SizedBox(
child: TextButton(
child: Image.asset('images/b.jpg'),
),
)
],
): /// here
Column(
children: [
SizedBox(
child: TextButton(
child: Image.asset('images/a.jpg'),
),
),
SizedBox(
child: TextButton(
child: Image.asset('images/b.jpg'),
),
),
],
)
Use Expanded as I used and solved the problem... Expanded solves this text-overflow problem if used in a proper way.
Below is my code:
Row(
children: <Widget>[
Expanded(
flex: 1,
child: Icon(
Icons.watch_later_outlined,
size: 25,
color: Colors.blueAccent,
),
),
Expanded(
flex: 5,
child: Text("Write your long text here"
),
), // name
]),