我是一个初学者,在flutter_bloc中,我试图在块构建器中获取小部件,但是获得"A构建函数返回空。违规的小部件是: blocbuilder。构建函数绝不能返回null“。下面是块代码和控制台中的空错误。══════════════════════
I/flutter (13632): The following assertion was thrown building BlocBuilder<NotificationB
我见过BlocProvider自动处理flutter_bloc包中的块。在将bloc/cubit作用域指定到单个小部件时也是如此吗?BlocBuilder<BlocA, BlocAState>( builder: (context, state) {
// return widget here based on BlocA's state