我最近开始学习Flutter并且非常喜欢它,但是在UI变化方面遇到了一些问题。感谢任何帮助!
我的目标是得到一个圆形按钮,上面有一个带蓝色背景的图标,并且按钮外面还有一个较深的蓝色边框。已经附上图片。
我的做法是:
- 得到一个圆形的蓝色按钮。
- 将图标放入按钮中。
- 添加边框。
我卡在第三步,因为我不知道如何添加边框,或者是否可能根据我处理问题的方式添加边框。目前特定颜色对我来说不重要,我稍后会更改主题。
这是我目前的代码:
var messageBtn = new Row(
children: <Widget>[
new Padding(
padding: const EdgeInsets.all(20.0),
child: new RawMaterialButton(
onPressed: _messages,
child: new Padding(
padding: const EdgeInsets.all(20.0),
child: new Icon(
Icons.message,
size: 30.0,
color: Colors.white,
),
),
shape: new CircleBorder(),
fillColor: Colors.deepPurple,
),
),
new Padding(
padding: const EdgeInsets.all(8.0),
child: new Text(
'Send Messages',
style: new TextStyle(
fontSize: 20.0,
),
)),
],
);
它产生这个:
我想要这个:
Material(type: MaterialType.transparency)
。我会更新答案。 - Xander