askNilesh / flutter_drawer_with_bloc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in blocs/nav_drawer_bloc.dart

aburcheri opened this issue · comments

The superclass 'Bloc<NavDrawerEvent, NavDrawerState>' doesn't have a zero argument constructor. Try declaring a zero argument constructor in 'Bloc<NavDrawerEvent, NavDrawerState>', or declaring a constructor in NavDrawerBloc that explicitly invokes a constructor in 'Bloc<NavDrawerEvent, NavDrawerState>'.

In class _MyHomePageState, in the initState() I changed
_bloc = NavDrawerBloc(NavDrawerState(NavItem.homePage));

and it is now working