How do I position a FloatingActionButton
on the left side inside a Scaffold
?
Currently the only available options are centerFloat
, centerDocked
, endFloat
and endDocked
.
Maybe Material Design does not intend to position the FAB at startFloat
or startDocked
.
That would be fine if RTL changed endFloat
and endDocked
to appear on the left side, but that is not the case.
Usually, the FloatingActionButton widget is placed in the bottom-right corner of the screen and is circular in shape.
A floating action button (FAB) is a circular button that triggers the primary action in your app's UI. This page shows you how to add the FAB to your layout, customize some of its appearance, and respond to button taps.
Changing the shape of the FAB. To change the shape of the button, we set the shape parameter in the constructor. The default value of the shape is a CircleBorder(). Let's make a square button instead of a round one.
In April 2020, the available options have been expanded and startFloat
as well as startDocked
are included options now.
Here is the full list of available options (see the FloatingActionButtonLocation
documentation):
centerDocked
centerFloat
centerTop
endDocked
endFloat
endTop
miniCenterDocked
miniCenterFloat
miniCenterTop
miniEndDocked
miniEndFloat
miniEndTop
miniStartDocked
miniStartFloat
miniStartTop
startDocked
startFloat
startTop
You can even easily define your own locations using StandardFabLocation
.
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