我有一个带有渐变的容器的登录应用程序,作为它的子项,另一个具有白色背景的容器。所以,我正在尝试制作一些透明背景的按钮,以便渐变背景变得可见,如按钮背景。
我得到了这个结果
我需要看起来像这样:
(不要考虑图标)
我的“按钮”代码是:
`Container(
width: 32.0,
height: 32.0,
decoration: new BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent
),
child: Center(child: Text("G", style: TextStyle(fontSize: 20, color:
Colors.black), textAlign: TextAlign.center))
),`
有什么建议吗?
你需要Font Awesome Icon pack for Flutter
class SO extends StatelessWidget {
Color bg = Colors.white;// change to whatever background color is behind icons
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Text("sign in with"),
CircleAvatar(
child: IconButton(icon: new Icon(FontAwesomeIcons.facebookF, color: bg), onPressed: () {}),
backgroundColor: const Color(0xffFF5486),
),
CircleAvatar(
child: IconButton(icon: new Icon(FontAwesomeIcons.twitter, color: bg), onPressed: () {}),
backgroundColor: const Color(0xffFF5486),
),
],
),
);
}
}