Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Position FloatingActionButton on the left side

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.

like image 578
creativecreatorormaybenot Avatar asked Jul 23 '18 21:07

creativecreatorormaybenot


People also ask

Where should floating action buttons be placed?

Usually, the FloatingActionButton widget is placed in the bottom-right corner of the screen and is circular in shape.

What is the floating button?

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.

How do you change the shape of the floating action button in flutter?

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.


1 Answers

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.

like image 172
creativecreatorormaybenot Avatar answered Sep 19 '22 00:09

creativecreatorormaybenot