4

Is there a way to dock the appbar at the bottom in flutter?

Thanks.

Raul Marquez
  • 948
  • 1
  • 17
  • 27

1 Answers1

11

AppBar is just a widget like any other. You can place it wherever you want.

Even in the bottomNavigationBar field of Scaffold.

final appBar = new AppBar(title: new Text("data"));
return new Scaffold(
  body: new Center(
    child: new FlatButton(
      child: new Text("data"),
    ),
  ),
  bottomNavigationBar: new SizedBox(
    height: appBar.preferredSize.height,
    child: appBar,
  ),
);

Although you may as well use BottomAppBar in this situation.

Rémi Rousselet
  • 256,336
  • 79
  • 519
  • 432
  • I tried bottomNavigationBar, but what it did was pull the bottom edge of the appBar all the way to the bottom, son now it fills the entire screen. This is the example I'm using which I'm trying to place on the bottom, BottomAppBar doesn't have the same properties as AppBar so it won't work. https://flutter.io/catalog/samples/app-bar-bottom/ – Raul Marquez May 04 '18 at 01:13