Created
June 16, 2020 10:15
-
-
Save doug-orchard/c57d496d68a54e1c6c5992f768659b17 to your computer and use it in GitHub Desktop.
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'; | |
import 'package:ursakta_mig/views/ticketsView.dart'; | |
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { | |
final double avatarSize = 24; | |
@override | |
Widget build(BuildContext _) { | |
return AppBar( | |
elevation: 0, | |
backgroundColor: Colors.transparent, | |
actions: <Widget>[ | |
GestureDetector( | |
onTap: () => Navigator.pushNamed(_, TicketsView().label), | |
child: Center( | |
child: Container( | |
margin: EdgeInsets.only(right: 16), | |
height: avatarSize, | |
width: avatarSize, | |
decoration: BoxDecoration( | |
color: Colors.red.withOpacity(.1), | |
borderRadius: BorderRadius.circular(avatarSize)), | |
child: Icon( | |
Icons.person, | |
color: Colors.red, | |
), | |
), | |
), | |
), | |
], | |
); | |
} | |
@override | |
Size get preferredSize { | |
return new Size.fromHeight(48.0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment