我想用一个图标制作一个带有圆形涟漪效果的按钮,我在网上看到过一些东西,但我做不到。这并不像应该那样直截了当。现在正在尝试使用这段代码。
InkWell(
onTap: () {},
splashColor: Colors.red,
highlightColor: Colors.white,
child: new Icon(
FontAwesomeIcons.chevronCircleUp,
size: 100,
),
)
我尝试了另一种方法,但我不明白为什么它们不能完美地居中对齐。
Container(
margin: EdgeInsets.all(0.0),
height: 100.0,
width: 100.0,
child: new RaisedButton(
padding: EdgeInsets.all(0.0),
elevation: 100.0,
color: Colors.black,
highlightElevation: 0.0,
onPressed: () {},
splashColor: Colors.red,
highlightColor: Colors.red,
//shape: RoundedRectangleBorder e tutto il resto uguale
shape: CircleBorder(
side: BorderSide(color: Colors.black, width: 5),
),
child: Icon(
FontAwesomeIcons.chevronCircleUp,
color: Colors.white.withOpacity(.8),
size: 80,
),
),
),
感谢您的帮助