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,
      ),
  );
}

来源:Flutter按钮添加背景图片及文字

相关文章:

  • 2021-04-11
  • 2021-08-15
  • 2021-09-25
  • 2021-09-05
  • 2021-05-04
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-11-07
  • 2021-11-23
  • 2022-12-23
相关资源
相似解决方案