Skip to content

Instantly share code, notes, and snippets.

@hnoor
Created June 20, 2020 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hnoor/db6ccd8c2779050d6363a3b4835543ab to your computer and use it in GitHub Desktop.
Save hnoor/db6ccd8c2779050d6363a3b4835543ab to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class CustomAppBar extends StatelessWidget {
final String title;
const CustomAppBar(
this.title, {
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
MediaQueryData mediaQuery = MediaQuery.of(context);
double height =
(mediaQuery.size.height - mediaQuery.padding.top) * HEADER_HEIGHT;
return Container(
height: height,
child: Row(
children: <Widget>[
IconButton(
color: Colors.black,
icon: Icon(Icons.chevron_left),
onPressed: () => Navigator.pop(context),
),
Text(title)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment