I have a login page which is functional. I'm using the BLoC pattern in flutter. What I want to achieve is toggling a loading screen overlay which I have code for using a stack.
Below is my build method
_loginBloc.loginController.stream.listen((event)=>{
Navigator.of(context).push(MaterialPageRoute(builder: (context) => HomePage()))
});
return Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
appBar: buildAppBar(context, "", isSearchView: false, showHome: false, elevation: 0.0),
body: StreamBuilder<String>(
stream: _loginBloc.processingController.stream,
builder: (context, processingSnapshot) {
return Stack(
children: <Widget>[
SingleChildScrollView(...),
if (processingSnapshot.hasData){ // <-- This is giving me an error
return Text("Loading overlay goes here");
}
],
);
}
)
);