This is a screenshot of Button default sizes (http://www.material-ui.com/#/components/floating-action-button)
The size of mini
button is 40x40px. Is there an easy way to reduce size to 30x30 or any other custom size? Say, by providing a prop={{size: '30:30'}}
or somehow by styling.
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.
Use a Container where you can specify width and height, then use a RawMaterialButton, like this: myFabButton = Container( width: 200.0, height: 200.0, child: new RawMaterialButton( shape: new CircleBorder(), elevation: 0.0, child: Icon( Icons.
Floating action buttons come in two sizes: Mini size: Only used to create visual continuity with other screen elements The button size should change from the default (56dp) to the mini size (40dp) when the screen width is 460dp or less.
In this article let’s discuss the Normal/Regular Floating Action Button and Mini Floating Action Button with a sample example in Android. Regular FABs are FABs that are not expanded and are regular size. The following example shows a regular FAB with a plus icon.
FloatingActionButton in Flutter. A floating action button is a circular icon button that hovers over content to promote a primary action in the application. Floating action buttons are most commonly used in the Scaffold.floatingActionButton field.
This will set 36dp size for all icons for floating action button. If you want to set icon size to particular Floating Action Button just go with Floating action button attributes like app:fabSize="normal" and android:scaleType="center".
For those still looking for a solution, I had to apply the style via the 'iconStyle' prop.
const myStyle = {
height: 20,
width: 20,
};
<FloatingActionButton iconStyle={ myStyle } />
For me, however, this caused an issue with my icon being off center. So myStyle then became:
const myStyle = {
height: 20,
lineHeight: '20px',
verticalAlign: 'middle',
width: 20,
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With