【发布时间】:2021-11-02 12:56:41
【问题描述】:
我还是编码新手,我创建了多个 textbutton.icon,但它们溢出了。我如何停止溢出。即使我放在一行或一列中,它仍然会溢出。我还想在每行按钮之间放置更多间距,但这只会让它溢出更多。下面是多类代码:
class home_buttons {
List<Widget> jeffButtons = [
Button1(),
Button2(),
Button3(),
Button4(),
Button5(),
Button6(),
Button7(),
Button8(),
Button9(),
];
}
这里是按钮代码:
class Button1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.fromLTRB(0.0, 9.0, 0.0, 0.0),
child: TextButton.icon(
onPressed: () => {},
icon: Column(
children: [
Icon(
Icons.search,
color: Colors.white,
size: 75,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Text(
'Contact Us',
style: TextStyle(
color: Colors.white,
),
),
),
],
),
label: Text(
'', //'Label',
style: TextStyle(
color: Colors.white,
),
),
),
);
}
}
【问题讨论】:
标签: flutter dart flutter-layout