Let's suppose i have the following bloc builder:
return BlocListener<LoginBloc, LoginState>(listener: (context, state) {
if (state is ErrorLoginState) {
showError(state.message, context);
}
}, child: BlocBuilder<LoginBloc, LoginState>(
builder: (context, state) {
if (state is StartLogin) {
return Center(
child: Loading(),
);
}
return Scaffold(
backgroundColor: Colors.white,
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 50.0),
child: Container(),
),
);
},
));
How could i pass the same widget, like a search bar, to all states rendering? The only way would be putting his code in all states conditionals?