Skip to content

Instantly share code, notes, and snippets.

@fabiomsr
Last active December 9, 2018 16:22
Show Gist options
  • Save fabiomsr/e78651dd15ff397558260f8df0fac073 to your computer and use it in GitHub Desktop.
Save fabiomsr/e78651dd15ff397558260f8df0fac073 to your computer and use it in GitHub Desktop.
Contact Page
class ContactPage extends StatelessWidget {
static const String routeName = '/contact';
final Contact _contact;
ContactPage(this._contact);
@override
Widget build(BuildContext context) {
return Theme(
data: ThemeData(
brightness: Brightness.light,
primarySwatch: _contact.gender == 'male' ? Colors.teal : Colors.pink
),
child: Scaffold(
body: CustomScrollView(
slivers: [
FlexibleAppBar(_contact.fullName, _contact.imageUrl),
SliverList(
delegate: SliverChildListDelegate(
<_ContactCategory>[
_buildPhoneCategory(),
_buildCategory(Icons.location_on, Icons.map,
<String>[_contact.location.street, _contact.location.city]),
_buildCategory(Icons.contact_mail, Icons.email, <String>[_contact.email]),
_buildCategory(Icons.today, Icons.add_alert,
<String>["Birthday ${_contact.birthday}"]),
]
)
)
]
)
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment