Last active
December 9, 2018 16:30
-
-
Save fabiomsr/3424bdd23a4b94d452381f491b6c42d8 to your computer and use it in GitHub Desktop.
Navigator push
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 _ContactListState extends State<ContactList> implements ContactListViewContract { | |
// ... | |
List<_ContactListItem> _buildContactList() { | |
return _contacts.map((contact) => | |
_ContactListItem ( | |
contact: contact, | |
onTap: () { _showContactPage(context, contact); } | |
)) | |
.toList(); | |
} | |
void _showContactPage(BuildContext context, Contact contact) { | |
Navigator.push(context, MaterialPageRoute<Null>( | |
settings: const RouteSettings(name: ContactPage.routeName), | |
builder: (BuildContext context) => ContactPage(contact) | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment