如何更改 FloatingActionButton 的大小? [英] How to change the size of FloatingActionButton?

查看:37
本文介绍了如何更改 FloatingActionButton 的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将大小设置为颤振中的 FloatingActionButton,我想设置 width/height,我的意思是,使按钮更大,我一直在寻找一个圆形按钮,但我得到的只有这个,所以,我开始使用它,但我需要它更大一点.

I'm trying to set a size to a FloatingActionButton in flutter, I wanna set width/height, I mean, make the button bigger, I was looking for a circular button, but the only one that I got was this one, so, I started to work with this, but I need it a little bigger.

推荐答案

使用 Container 可以指定 widthheight,然后使用 RawMaterialButton,像这样:

Use a Container where you can specify width and height, then use a RawMaterialButton, like this:

final myFabButton = Container(
  width: 200.0,
  height: 200.0,
  child: new RawMaterialButton(
    shape: new CircleBorder(),
    elevation: 0.0,
    child: Icon(
      Icons.favorite,
      color: Colors.blue,
    ),
    onPressed: () {},
  ),
);

这篇关于如何更改 FloatingActionButton 的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆