Created
June 15, 2019 22:39
-
-
Save timbergus/101fd59f8550a0926d90cea366474905 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
body: StreamBuilder( | |
stream: Firestore.instance | |
.collection('feed') | |
.where('email', isEqualTo: '[email protected]') | |
.snapshots(), | |
builder: (context, snapshot) { | |
if (!snapshot.hasData) { | |
return Text('Loading...'); | |
} | |
return ListView.builder( | |
itemCount: snapshot.data.documents.length, | |
itemBuilder: (context, index) { | |
return Container( | |
height: 50, | |
padding: EdgeInsets.only( | |
left: 20, | |
), | |
alignment: Alignment.centerLeft, | |
color: index % 2 == 0 ? Colors.yellow[100] : Colors.white, | |
child: Text( | |
'${snapshot.data.documents[index]['message']}', | |
style: TextStyle( | |
fontSize: 20, | |
), | |
), | |
); | |
}, | |
); | |
}, | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment