Flutter按钮添加背景图片及文字【转】
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,
),
);
}