Skip to content

Instantly share code, notes, and snippets.

@fabiomsr
Last active December 9, 2018 16:29
Show Gist options
  • Save fabiomsr/e69633a2425b2978acc9c63a1c64c763 to your computer and use it in GitHub Desktop.
Save fabiomsr/e69633a2425b2978acc9c63a1c64c763 to your computer and use it in GitHub Desktop.
Build categories
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