Flutter How to create reusable custom Appbar widget

preview_player
Показать описание
in this flutter tutorial i will show how to create a reusable custom AppBar widget. using a custom Appbar widget instead of flutter default will make your workflow faster and save a lot of time.

_____________________

👉 Recommended Laptops for Flutter Development:

More Flutter Tutorials:

Flutter login & register page ui design

Chat Application UI Design

Flutter Resources for learning flutter

#flutter #dart #programming #appbar #widget
Рекомендации по теме
Комментарии
Автор

Thank you so much, it was fast and easy !

lear
Автор

If anyone has unwanted space at the bottom of their custom AppBar, try replacing the value inside "Size.fromHeight(60.0)" to

williamdupont
Автор

Thank you so much, very helpful.
Just one note:
we should add *required* before this.title and this.backgroundColor.

aymiechalouhy
Автор

Drawr is not fully streached it open to appbar only

indorilaal
Автор

Thank you -- everything works up to 4:12 .... getting errors on second page... ```import
import

class SecondPage extends StatelessWidget {
const SecondPage({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return const Scaffold(
appBar: CustomAppbar( <<--From here = The method 'CustomAppbar' isn't defined for the type 'SecondPage'.
backgroundColor: Colors.green,
title: 'Second Page',
),
body: Center(
child: Text('Second Page'),
),
);
}
}```

ai-meta-dev
Автор

Careful you don't accidentally use "PreferredSize' instead of 'PreferredSizeWidget' in the class implementation. It ask for a child parameter which had me googling for a bit.

camow
Автор

provide the source code as well, if possible.

shubhamgothi