I am getting same error but while navigating to a page from a drawer. Below is the code but after number of attempts unable to find solution.
Navigator.push(context,MaterialPageRoute(builder: (context){
final nbloc = BlocProvider.of<NotificationBloc>(context);
return BlocProvider(child: NotificationPage(), bloc: nbloc);
}));
I am getting same error but while navigating to a page from a drawer. Below is the code but after number of attempts unable to find solution.
Navigator.push(context,MaterialPageRoute(builder: (context){
final nbloc = BlocProvider.of<NotificationBloc>(context);
return BlocProvider(child: NotificationPage(), bloc: nbloc);
}));