How to change the size of FloatingActionButton?
wrap your FAB with a FittedBox
inside a Container
or SizedBox
and then change the width and the height of it.
example :
floatingActionButton: Container(
height: 100.0,
width: 100.0,
child: FittedBox(
child: FloatingActionButton(onPressed: () {}),
),
),
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: () {},
),
);
You do not have to reinvent the wheel, flutter team knew it will be needed.
Instead of using regular FloatingActionButton()
use FloatingActionButton.extended()
example code:
FloatingActionButton.extended(
onPressed: () {},
icon: Icon(Icons.save),
label: Text("DOWNLOAD"),
),
src: proandroiddev