Skip to content

Instantly share code, notes, and snippets.

@this-is-richard
Last active March 11, 2019 04:58
Show Gist options
  • Save this-is-richard/fedfe7d3c3b6a7909a2f508406c2ddbb to your computer and use it in GitHub Desktop.
Save this-is-richard/fedfe7d3c3b6a7909a2f508406c2ddbb to your computer and use it in GitHub Desktop.
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