小编Kat*_*evi的帖子

如何在边框按钮上添加边框?

我最近才陷入困境,到目前为止,我一直很喜欢它,但是我一直在进行一些UI更改。任何帮助表示赞赏!

我的目标是得到一个圆形按钮,该按钮带有蓝色背景的图标,但外面有一个较深的蓝色边框。附有图片。

我的方法是:

  1. 获取一个圆形的蓝色按钮。
  2. 在该按钮上放置一个图标。
  3. 添加边框。

我陷入了第3步,因为我不知道如何添加边框,或者考虑到我解决问题的方式,是否还有可能。目前,具体颜色对我来说并不重要,稍后我将更改主题。

这是我目前有代码明智的地方:

  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,
          ),
        )),
  ],
);
Run Code Online (Sandbox Code Playgroud)

产生此结果:请参阅屏幕截图

我想要这个:请看第二张截图

icons border button dart flutter

6
推荐指数
3
解决办法
6966
查看次数

标签 统计

border ×1

button ×1

dart ×1

flutter ×1

icons ×1