Last active
March 11, 2019 04:58
-
-
Save this-is-richard/fedfe7d3c3b6a7909a2f508406c2ddbb to your computer and use it in GitHub Desktop.
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
import 'package:flutter/material.dart'; | |
class ChatList extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return ListView.builder(itemBuilder: (context, index) { | |
return ListTile( | |
title: Text('Contact $index'), | |
//// onTap START //// | |
onTap: () { | |
Navigator.push(context, MaterialPageRoute(builder: (context) { | |
return ChatRoom(_chatItems[index]); // passing data to chat room | |
})); | |
}, | |
//// onTap END //// | |
); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment