Created
September 7, 2020 08:19
-
-
Save dylansalim3/ecc578e4a4e71f532401c84bed790577 to your computer and use it in GitHub Desktop.
Custom App Bar Flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomAppBar extends PreferredSize { | |
final Widget child; | |
final double height; | |
CustomAppBar({@required this.child, this.height = kToolbarHeight}); | |
@override | |
Size get preferredSize => Size.fromHeight(height); | |
@override | |
Widget build(BuildContext context) { | |
return | |
Container( | |
height: preferredSize.height, | |
alignment: Alignment.center, | |
child: child, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment