【发布时间】:2019-05-13 15:48:56
【问题描述】:
我正在尝试实现一个没有边距的按钮。
我的代码是:
@override
Widget build(BuildContext context) {
return new AppState(
child: new Scaffold(
appBar: AppBar(
backgroundColor: Color(0xFF031e39),
title: Text("MY APP"),
),
body:
ButtonTheme(
buttonColor: Color(0xFF031e39),
minWidth: double.infinity,
child: FlatButton(
color: Color(0xFF81A483),
onPressed: () {
launchSearch();
},
child: Text('Search',style: TextStyle(color: Colors.white),),
),
)
),
);
}
结果是:
我尝试了所有不同的方法,但我无法找到解决方案,因此按钮没有边距。
如果我将一个小部件放在我的按钮顶部的列中,我会得到相同的结果:
我怎样才能有一个没有任何边距的平面按钮?
【问题讨论】: