What is the fancy way to use SnackBar in StreamBuilder?
First, you must ensure that you are always returning a widget
and then you can schedule the SnackBar
for the end of the frame
if(state is AuthUnauthenticated){
WidgetsBinding.instance.addPostFrameCallback((_) => _showErrorMessage(state.errorMessage));
return Container();
}
You should also check if the data
is null o the snapshot
has data.