AppBar — what it is, configuration and Flutter widgets

Author: IT Sectr Published: 2026-07-02 Reading time: 9 min

AppBar is a top screen panel widget in Flutter that implements the Material Design component with a title, actions, navigation button and tabs. Unlike a custom panel using Row or Stack, AppBar provides a ready-made architecture with correct height of 56dp (48dp in collapsed state) and automatic SafeArea handling. According to Flutter API Reference (2026), AppBar supports scroll animation through SliverAppBar and integration with Material 3 via the forceMaterialTransparency parameter. In a typical mobile application, AppBar serves as a navigation and information hub, combining the page title, system actions, and section switching.

Key Takeaways

  • AppBar — top panel widget in Flutter with title, actions, leading and support for TabBar and Material 3
  • Title — the title text, centered or left-aligned depending on the platform
  • Actions — a list of action widgets (IconButton, PopupMenuButton) placed on the right side of AppBar
  • Leading — left navigation button (“hamburger” icon for Drawer or “Back” button for nested screens)
  • Bottom — the bottom area of AppBar for embedding TabBar, PreferredSize or custom widgets

What is AppBar in Flutter

AppBar is a standard Material top panel component that appears at the top of a Scaffold. It contains the screen title, a navigation button (usually a “hamburger” icon or “Back” arrow) and actions — icons that open search, settings or other functions. AppBar automatically adapts to the platform: on Android it uses the standard Material bottom-shadow, on iOS — a flatter design with transparency.

AppBar implements the PreferredSizeWidget interface, which means its height is fixed and known before building. By default, AppBar height is 56dp on Android and 44dp on iOS in portrait orientation, taking SafeArea into account at the top. This feature allows Scaffold to calculate available space for body in advance, avoiding recomposition during rendering.

According to Flutter Material Library Guide (2026), AppBar has gone through several iterations: in Flutter 1.x it was a simple container with text, in Flutter 2.x it gained support for Material 3 and flexibleSpace, and in Flutter 3.x — integration with System UI (status bar color, transparency). The modern AppBar supports Dynamic Color from Material You on Android 12+ devices.

AppBar Structure: Properties and Parameters

AppBar provides a set of parameters that control each part of the top panel. Understanding these properties allows flexible customization of the panel for any design requirements without creating custom solutions.

PropertyTypeDescription
titleWidget?Main panel title, usually Text with the screen name
leadingWidget?Widget to the left of the title (“Back” button or menu icon)
actionsList<Widget>?List of action widgets on the right (IconButton, PopupMenuButton)
bottomPreferredSizeWidget?Bottom area for TabBar or a custom widget
flexibleSpaceWidget?Background widget that animates on scroll in SliverAppBar
backgroundColorColor?Panel background color, overriding theme color
elevationdoubleShadow under the panel, creating a raised effect above content
centerTitlebool?Title centering (true — Material 3 behavior, false — Android style)

Title and leading: configuring title and navigation

The title property accepts any widget, but Text with style configuration via TextStyle is most commonly used. For long titles, it is recommended to wrap the title in Flexible so that the text truncates correctly when space is limited. The leading property is automatically replaced with BackButton when navigating to a nested screen via Navigator.push, if not set explicitly.

Actions: placing action icons

The actions list contains widgets aligned to the right edge of AppBar. Each element should be no wider than 48dp (Material Design standard). To group actions, use PopupMenuButton — this hides less important options in a dropdown menu and complies with Material recommendations for interface density.

AppBar Customization: Styles, Colors and Behavior

AppBar supports deep customization through color, shadow and padding properties. The basic styling is inherited from the app theme, but each property can be overridden individually. Let’s look at the main configuration scenarios.

The background color of AppBar is set via backgroundColor. If not specified, appBarTheme from ThemeData is used. In Material 3, AppBar color is automatically calculated from ColorScheme.primary, but it can be overridden for a specific screen. For a transparent AppBar (often used in profiles), set backgroundColor: Colors.transparent with elevation: 0.

The elevation property controls the shadow under AppBar. A value of 0 removes the shadow, creating a “flat” panel effect, which is relevant for Material 3. A value of 4 gives the standard Material Design shadow. For custom shadow control, use shadowColor — the shadow color that visually separates the panel from the content.

To control text color in AppBar, use foregroundColor. This property affects the color of the title, icons and text in actions. When backgroundColor changes, a contrasting foregroundColor is automatically selected, but it can be forced for non-standard designs.

SliverAppBar: An Animated Version of AppBar

SliverAppBar is an extension of AppBar for use inside CustomScrollView that supports scroll animation: collapsing, parallax effect and pinned mode. Unlike a standard AppBar, SliverAppBar is a sliver widget and can dynamically change size depending on the scroll position.

The main SliverAppBar modes are determined by a combination of pinned, floating and snap properties. In pinned mode, the panel always remains visible at the top of the screen. In floating mode, it appears when scrolling back. The floating + snap combination creates a “sticky” panel behavior that appears at the slightest upward scroll, often used in news feeds.

According to Flutter API SliverAppBar (2026), to use SliverAppBar you need to replace a regular ListView or Column with CustomScrollView containing sliver widgets. Scaffold continues to work correctly, but the appBar property of Scaffold must be null — SliverAppBar is placed inside CustomScrollView as the first sliver.

AppBar Configuration Example in an Application

Let’s look at an AppBar example with search, dropdown menu and TabBar. This code demonstrates a typical top panel configuration in a production Flutter application.

dart
Scaffold(
  appBar: AppBar(
    title: const Text('Catalog'),
    centerTitle: true,
    leading: IconButton(
      icon: const Icon(Icons.menu),
      onPressed: () => Scaffold.of(context).openDrawer(),
    ),
    actions: [
      IconButton(
        icon: const Icon(Icons.search),
        onPressed: () => showSearch(context: context, delegate: ProductSearch()),
      ),
      PopupMenuButton<String>(
        onSelected: (String value) {},
        itemBuilder: (context) => [
          const PopupMenuItem(value: 'settings', child: Text('Settings')),
          const PopupMenuItem(value: 'about', child: Text('About App')),
        ],
      ),
    ],
    bottom: const TabBar(
      tabs: [
        Tab(text: 'All'),
        Tab(text: 'New'),
        Tab(text: 'Popular'),
      ],
    ),
  ),
  body: const TabBarView(
    children: [
      AllProductsPage(),
      NewProductsPage(),
      PopularProductsPage(),
    ],
  ),
)

In the example, AppBar contains a centered title, a Drawer open button on the left, a search icon and a dropdown menu on the right. TabBar in the bottom allows switching between product categories. This configuration covers most mobile app scenarios: navigation, search, additional options and section switching — all in one top panel.

Frequently Asked Questions

How to change AppBar height in Flutter?

AppBar height is fixed (56dp) and cannot be changed directly. For a custom height, use PreferredSize wrapping a custom widget of the desired height. Alternatively, use SliverAppBar with collapsedHeight for flexible size management in the collapsed state without losing standard panel functionality.

How to remove the shadow under AppBar?

Set the elevation: 0 property in the AppBar constructor. This removes the shadow and makes the panel visually flat, matching the Material 3 style. For full control, use shadowColor: Colors.transparent to override the shadow color without changing elevation, if you need to keep the z-coordinate.

How is AppBar different from SliverAppBar?

AppBar is a static panel with fixed height, placed in Scaffold.appBar. SliverAppBar is a dynamic version used inside CustomScrollView that can collapse, pin and animate on scroll. SliverAppBar provides collapsedHeight, expandedHeight, pinned and floating properties for flexible scroll behavior management.

How to add search to AppBar?

Add an IconButton with a search icon to the actions list. On press, you can call showSearch with a custom SearchDelegate that opens the search screen with automatic animation. Alternatively, replace the title with a TextField, turning AppBar into an inline search bar, which is convenient for catalogs and lists.

Why is the title not centered in AppBar?

By default centerTitle is null, and behavior depends on the platform: on Android the title is left-aligned, on iOS — centered. Explicitly set centerTitle: true for forced centering on both platforms. If the title is not centered due to leading, check that leading is not null — its presence shifts the title to the right.

Summary

  • AppBar — standard top panel in Flutter with title, leading, actions and bottom for TabBar, automatically handling SafeArea
  • Title — the central element of the panel, accepting any widget with centering configuration via centerTitle
  • Actions — a list of action widgets on the right, each up to 48dp wide per Material Design standard
  • Leading — navigation button on the left, automatically replaced with BackButton when navigating to a nested screen
  • SliverAppBar — AppBar extension for CustomScrollView with support for collapsing, pinning and parallax effect
  • Material 3 — AppBar supports Dynamic Color, transparency and NavigationBar through the forceMaterialTransparency parameter
  • Customization — backgroundColor, elevation, foregroundColor and shadowColor properties allow precise visual tuning for project design

We will develop a mobile application turnkey

IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.

Discuss the project

Read also