实现下图的一个按钮
代码如下
/// 登录按钮
Widget buildLoginButtonWidget() {
return Container(
margin: EdgeInsets.only(top: 40, left: 16, right: 16),
width: MediaQuery.of(context).size.width - 32,
height: 50,
decoration: BoxDecoration(
color: Colors.transparent,
image: DecorationImage(
image: AssetImage('images/login_button.png'), fit: BoxFit.fill),
borderRadius: BorderRadius.circular(25.0),
),
child: FlatButton(
onPressed: () {
},
child: Text("登录"),
textColor: Colors.white,
color: Colors.transparent, // 透明色
)
);
}