Last active
December 9, 2018 16:29
-
-
Save fabiomsr/e69633a2425b2978acc9c63a1c64c763 to your computer and use it in GitHub Desktop.
Build categories
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
class ContactPage extends StatelessWidget { | |
// ... | |
_ContactCategory _buildPhoneCategory() { | |
var phoneItems = _contact.phones.map((phone) => | |
_ContactCategoryItem( | |
icon: Icons.message, | |
lines: <String>[phone.number, phone.type] | |
)).toList(); | |
return _ContactCategory( | |
icon: Icons.call, | |
children:phoneItems | |
); | |
} | |
_ContactCategory _buildCategory(IconData categoryIcon, IconData categoryItemIcon, | |
List<String> lines) { | |
return _ContactCategory( | |
icon: categoryIcon, | |
children: <_ContactCategoryItem>[ | |
_ContactCategoryItem( | |
icon: categoryItemIcon, | |
lines: lines | |
) | |
] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment