Last active
February 17, 2021 11:11
-
-
Save duytq94/f6acc29b9fd4d379b96d9d9b47df1acc 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
Container( | |
child: StreamBuilder( | |
stream: Firestore.instance.collection('users').limit(_limit).snapshots(), | |
builder: (context, snapshot) { | |
if (!snapshot.hasData) { | |
return Center( | |
child: CircularProgressIndicator( | |
valueColor: AlwaysStoppedAnimation<Color>(themeColor), | |
), | |
); | |
} else { | |
return ListView.builder( | |
padding: EdgeInsets.all(10.0), | |
itemBuilder: (context, index) => buildItem(context, snapshot.data.documents[index]), | |
itemCount: snapshot.data.documents.length, | |
); | |
} | |
}, | |
), | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment