Flutter AppBar - All Common Properties
Scaffold(
appBar: AppBar(
// AppBar এর Title
title: Text("Home Page"),
// Title Center এ থাকবে কিনা
centerTitle: true,
// Title এর Style
titleTextStyle: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white,
),
// Leading Widget (সাধারণত Back Button)
leading: Icon(Icons.menu),
// Leading Widget এর Width
leadingWidth: 60,
// Automatically Back Button দেখাবে কিনা
automaticallyImplyLeading: true,
// Title এর আগে Widget
flexibleSpace: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.blue,
Colors.purple,
],
),
),
),
// Right Side Widgets
actions: [
IconButton(
onPressed: () {},
icon: Icon(Icons.search),
),
IconButton(
onPressed: () {},
icon: Icon(Icons.notifications),
),
],
// Background Color
backgroundColor: Colors.blue,
// Foreground Color (Text + Icon)
foregroundColor: Colors.white,
// Shadow Color
shadowColor: Colors.black,
// Elevation
elevation: 8,
// Scroll করলে Elevation
scrolledUnderElevation: 12,
// Bottom Widget
bottom: PreferredSize(
preferredSize: Size.fromHeight(50),
child: Text(
"Bottom Widget",
),
),
// Toolbar Height
toolbarHeight: 70,
// Toolbar Opacity
toolbarOpacity: 1.0,
// Bottom Opacity
bottomOpacity: 1.0,
// AppBar Shape
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(20),
),
),
// AppBar এর নিচে Shadow দেখাবে কিনা
forceMaterialTransparency: false,
// Primary AppBar কিনা
primary: true,
// Title ও Actions এর মাঝে Space
actionsPadding: EdgeInsets.only(
right: 10,
),
// Icon Theme
iconTheme: IconThemeData(
color: Colors.white,
size: 28,
),
// Action Icon Theme
actionsIconTheme: IconThemeData(
color: Colors.yellow,
size: 26,
),
// System Status Bar Style
systemOverlayStyle: SystemUiOverlayStyle.light,
// AppBar এর Clip Behavior
clipBehavior: Clip.none,
),
body: Center(
child: Text("Flutter AppBar"),
),
);
📌 AppBar Properties Summary
| Property | কাজ |
|---|
| title | AppBar এর Title |
| centerTitle | Title Center করবে |
| leading | Left Side Widget |
| actions | Right Side Widgets |
| backgroundColor | Background Color |
| foregroundColor | Text/Icon Color |
| elevation | Shadow Height |
| shadowColor | Shadow Color |
| toolbarHeight | AppBar Height |
| flexibleSpace | Custom Background |
| bottom | TabBar বা Bottom Widget |
| shape | Custom Shape |
| iconTheme | Leading Icon Style |
| actionsIconTheme | Action Icon Style |
| titleTextStyle | Title Text Style |
| systemOverlayStyle | Status Bar Style |
| scrolledUnderElevation | Scroll হলে Elevation |
| automaticallyImplyLeading | Auto Back Button |
| leadingWidth | Leading Widget Width |
| actionsPadding | Actions এর Padding |
| primary | Primary AppBar কিনা |
| clipBehavior | Overflow Clip Control |
Comments
Post a Comment