Flutter Appbar Widget

Source Code​

				
					AppBar(
  title: Text(
    'Todo App',
    style: TextStyle(
      fontWeight: FontWeight.bold,
      color: Colors.white,
      fontSize: 20,
    ),
  ),
  backgroundColor: Colors.teal,
  centerTitle: true,
  elevation: 4,
  actions: [
    IconButton(
      icon: Icon(Icons.search),
      onPressed: () {
        
      },
    ),
    IconButton(
      icon: Icon(Icons.settings),
      onPressed: () {
        
      },
    ),
  ],
)

				
			

Ai Code Analizer

🔍 Detailed Overview of AppBar with Text Title

📌 1. What is AppBar?

AppBar is a pre-built material design widget provided by Flutter. It’s commonly used within a Scaffold and appears at the top of the app screen. It typically includes:

  • A title (usually text),

  • Navigation icons (like back or menu),

  • Action buttons (e.g., search, settings),

  • Optional widgets like bottom (for tabs).

🎨 3. Key Properties You Can Customize in AppBar

PropertyDescription
titleWidget displayed in the center or start of the AppBar. Often a Text.
backgroundColorChanges the AppBar’s background color.
leadingWidget shown at the start (like a back button or menu).
actionsList of widgets shown at the end (like icons or buttons).
centerTitleWhether to center the title (true/false).
elevationShadow depth under the AppBar.
bottomAllows adding a TabBar or other widgets under the AppBar.
iconThemeControls icon color, size, etc.
titleTextStyleDirectly set style for the title.