Search⌘ K
AI Features

AppBar Widget

Explore how to add and customize the AppBar widget in Flutter to build a contact profile page for Android. Learn to set background colors, add navigation icons like a back arrow, and include actionable icons such as a star button. This lesson guides you through incorporating these elements in your app to enhance user interaction and interface design.

Add AppBar #

The AppBar widget is the main widget in an Android app that sits at the top of the application and displays title, leading icon, toolbar widgets, and actions.

Let’s get started with assigning AppBar widget to appBar property of Scaffold widget.

class ContactProfilePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(),
      ),
    );
  }
}

At this point, the app bar will be available in the default ...