Last active
April 11, 2020 07:43
-
-
Save riscait/ab661af9690d1f274eb39d2903f5d751 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: const Text('Screen title'), | |
leading: _buildProfileIconButton(), | |
), | |
body: /* Main contents */ | |
) | |
} | |
Widget _buildProfileIconButton() { | |
const iconSize = 32.0; | |
return IconButton( | |
icon: photoUrl == null | |
? Icon( | |
Icons.account_circle, | |
size: iconSize, | |
) | |
: CircleAvatar( | |
backgroundImage: NetworkImage(photoUrl), | |
backgroundColor: Colors.transparent, | |
radius: iconSize / 2, | |
), | |
onPressed: /* Action */, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment