@override
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
color: Colors.white,
child: Scaffold(
body: BlocBuilder
builder: (context, state) {
if (state is RestaurantInitialState) {
_shimmerList();
} else if (state is Loading) {
_shimmerList();
} else if (state is RestaurantMenuFetched) {
return _menuListItem(state.response);
} else if (state is Failed) {
return buildErrorUi(state.message);
} else {
return buildErrorUi(StringResources.somethingWentWrong);
}
}
),
),
);
}
Hi @mahisingh1 馃憢
Thanks for opening an issue!
Can you please describe the problem you're having more clearly and provide a link to a complete application that reproduces the issue? Thanks 馃憤
I am working with Bloc . I have provided bloc builder to widget , now the problem is on the very first time it shows Build function returns null after that is works perfectly.
@mahisingh1 it looks like you're not returning a widget. Please add a return before _shimmerList and let me know if that helps 馃憤
if (state is RestaurantInitialState) {
return _shimmerList();
} else if (state is Loading) {
return _shimmerList();
} else if (state is RestaurantMenuFetched) {...}
Ohh! Thanks a lot , i thought it would return from the internal methods widgets :D
Now its working fine 馃憤
Most helpful comment
Ohh! Thanks a lot , i thought it would return from the internal methods widgets :D
Now its working fine 馃憤