Skip to content

Instantly share code, notes, and snippets.

@doug-orchard
Created June 16, 2020 10:15
Show Gist options
  • Save doug-orchard/c57d496d68a54e1c6c5992f768659b17 to your computer and use it in GitHub Desktop.
Save doug-orchard/c57d496d68a54e1c6c5992f768659b17 to your computer and use it in GitHub Desktop.
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