Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the size of FloatingActionButton?

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.

like image 412
Joseph Arriaza Avatar asked Oct 12 '18 20:10

Joseph Arriaza


People also ask

How do I make my floating action button smaller in flutter?

By default, the floating action button in flutter is 56 logical pixels height and width. This is the normal size or non-mini size. If you add this property mini with a value true, it will create a smaller floating action button.

What is fab size?

FAB containers come in two sizes: 1. Default (56 x 56dp) 2. Mini (40 x 40dp)


1 Answers

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: () {}),         ),       ), 

enter image description here

like image 69
Raouf Rahiche Avatar answered Sep 27 '22 21:09

Raouf Rahiche