Reputation: 99
I try to experience Firebase Live database with flutter. I just would like to get a value in the datasnapshot of the firebase response.
Upvotes: 0
Views: 5704
Reputation: 5408
Check this example application in Flutter's Firebase Database plugin.
Upvotes: 1
Reputation: 957
For this you will want to use a FirebaseAnimatedList
. All you have to do is pass in is the reference to your database then you can access your data using snapshot.value
.
return FirebaseAnimatedList(
query: FirebaseDatabase.instance.reference().child('users/' + user.uid),
itemBuilder: (context, snapshot, animation, index) {
return Row(children: <Widget>[
Text(
snapshot.value['source'],
style: TextStyle(fontSize: 13.0),
),
]);
});
Upvotes: 2