I'm super new to flutter and firebase and trying to query some data from the firebase realtime database using the FirebaseAnimatedList in the example code below I try to pass this.userid to fetch data according to the value being passed but sometimes database might not have data according to what's being passed. I just want to know how to handle such cases and show a feedback saying there's no data that matched the query. It's basically a search where it might not have values that user look for.
example code:
FirebaseAnimatedList(
query: ref.child("users").orderByChild("id").equalTo(this.userid),
itemBuilder: (BuildContext context, DataSnapshot snapshot,
Animation<double> animation, int index) {
return SizeTransition(
sizeFactor: animation,
axis: Axis.horizontal,
axisAlignment: -0.8,
child: Column(
textDirection: TextDirection.ltr,
verticalDirection: VerticalDirection.down,
children: <Widget>[
SizedBox(
height: 100.0,
),
Text(
"User ID : " + snapshot.value["id"],
),
SizedBox(
height: 50.0,
),
],
),
);
}));