Trick AppBar Widget.

Patarchims
2 min readAug 13, 2022

How to deal with Appbar? UI makes for a better design. And create a variety of attractive displays.

Maybe we think that this ui is done by custom. Using the Stack, and Position widget.

Maybe we’ll spend some time customizing a look the ui designer gives us.In this case, it’s not necessary. AppBar widgets can do it. And how?

In this article the author will tell you a trick to do it.

Elevation to cast a shadow effect on the appbar. foregroundColor gives color to the icon back, backgroundColor gives color to AppBar, we can give color transparent. title is the parameter that the widget accepts,. we can give a Text widget here. And give centerTitle true, so that the text widget is in the middle.

With this we don’t have to do anything superfluous. Custom widget with a case like this. We might think this is done with the Stack widget, with the position adjusted to the design.

The result will look like the image below:

Full code below :

--

--