skip to Main Content

Scaffold(
floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
floatingActionButton: SizedBox(
width: size.width,
child: customButton(title: "Next", ontap: () {})),
body: Column(children:…mychilderns)
);

And it Shows something like this.

I have tried but i am expecting like this

2

Answers


  1. try giving width = double.infinity;

    Login or Signup to reply.
  2. You can use floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked instead.

    Basically the FloatingActionButtonLocation predefined values are refer to the X (center) and Y (docked) axis accordingly (as for the centerDocked example). So with this in mind you can better use the offered combinations.

    Also you can set any location you want by defining a custom offset like so:

    class CustomFloatingActionButtonLocation extends FloatingActionButtonLocation {
      @override
      Offset getOffset(ScaffoldPrelayoutGeometry scaffoldGeometry) {
        return Offset(
          scaffoldGeometry.scaffoldSize.width -
              scaffoldGeometry.floatingActionButtonSize.width,
          scaffoldGeometry.scaffoldSize.height -
              scaffoldGeometry.floatingActionButtonSize.height,
        );
      }
    }
    

    and then using that as floatingActionButtonLocation value.

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