skip to Main Content

The position of floating action button is not in the default position, when i use it in a Column to use two FloatingActionButton

What do i do…?

How to make it in the default position..?

2

Answers


  1. Default Column‘s mainAxisSize: MainAxisSize.max. Using mainAxisSize: MainAxisSize.min, will serve the thing you are trying to get.

    return Scaffold(
      floatingActionButton: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          FloatingActionButton(onPressed: () {}),
          FloatingActionButton(onPressed: () {})
        ],
      ),
    );
    
    Login or Signup to reply.
  2. According the documentation

    Use at most a single floating action button per screen. Floating
    action buttons should be used for positive actions such as "create",
    "share", or "navigate".

    Do it in right way. Use RawMaterialButton and style it as you wish.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search