How to Create an AppBar in Flutter?
AppBar is one of the most commonly used Flutter widgets. AppBar is used to provide information and actions related to the current screen of the app. An AppBar consists of leading, title, and actions widget. The leading property is displayed before the title and is optional. The actions property is a list of widgets displayed after the title and is also an optional property.
To create a simple AppBar, you just need to add an AppBar() widget to the appBar property of a Scaffold. The code for the AppBar is shown below. The title of the AppBar can be added using the title property. It has a number of optional properties that can be used to customize the AppBar such as background color, shadow color, elevation etc.
AppBar with Actions
To create a set of actions in the AppBar, we use a property called actions in the AppBar. The actions property is a list and can contain the icon widgets. The code is shown below.
By default, AppBar does not have the feature to add a gradient background feature. So, we use another widget called PreferredSize to achieve this effect. Here, we use a property called decoration to add a BoxDecoration widget to the PreferredSize widget. The code for the gradient background is shown below.
How to add a navigation drawer in Flutter?
Step by step tutorial on how to add a navigation drawer in Flutter
Polygon clipper in Flutter
A guide on how to clip images in various polygon shapes using polygon_clipper in Flutter
How to do hero animation in Flutter?
Step by step guide on how to do hero animation in Flutter