Last active
September 6, 2022 20:35
-
-
Save hnoor/10c83b18a5997886fc1dcf015cfe6796 to your computer and use it in GitHub Desktop.
code for custom app bar.
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
import 'package:flutter/material.dart'; | |
class CustomAppBar extends StatelessWidget with PreferredSizeWidget { | |
final String title; | |
@override | |
final Size preferredSize; | |
CustomAppBar( | |
this.title, { | |
Key key, | |
}) : preferredSize = Size.fromHeight(50.0), | |
super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return AppBar( | |
title: Text( | |
title, | |
style: TextStyle(color: Colors.black), | |
), | |
backgroundColor: Colors.white, | |
leading: IconButton( | |
icon: Icon(Icons.chevron_left), | |
onPressed: () => Navigator.pop(context), | |
color: Colors.black, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment