Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

Thanks.

like image 624
Raul Marquez Avatar asked Jan 02 '23 10:01

Raul Marquez


1 Answers

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.

like image 121
Rémi Rousselet Avatar answered Feb 08 '23 23:02

Rémi Rousselet