Flutter按钮添加背景图片及文字的一种方法,记录下,上代码
Widget picAndTextButton(String imgpath,String text) {
return Container(
width: 200,
height: 60,
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
image: AssetImage(path),
fit: BoxFit.fill
),
),
alignment: Alignment.center,
child: FlatButton(
onPressed: _theDayBefor,
child: Text(text),
color: Colors.transparent,
),
);
}
版权声明:本文为WC270607563原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。