I thought I understood StreamBuilders but I have some doubts that are puzzling me.
I thought that a ConnectionState.waiting means that the connection with the stream is
I suggest you drop the if/else condition and use a switch to check for the ConnectionState.
switch(snapshot.connectionState){
case ConnectionState.waiting:
return Center(child:CircularProgressIndicator());
break;
default:
if(snapshot.hasError){
// Handle errors
}else if(!snapshot.hasData){
// Handle no data
}else {
// Check for null
var result = snapshot.data
if(result!=null){
//Handle the null value
} else {
}
}
break;
}