小编tol*_*ler的帖子

错误状态:在没有注册事件处理程序的情况下调用了 add Fetch Article

class _HomePageState extends State<HomePage> {
  late ArticleBloc articleBloc;

  @override
  void initState() {
    super.initState();
    articleBloc = BlocProvider.of<ArticleBloc>(context);
    articleBloc.add(FetchArticlesEvent());
  }

  @override
  Widget build(BuildContext context) {
    return Container();
  }
}
Run Code Online (Sandbox Code Playgroud)

它以前可以工作,但现在代码不起作用。

我尝试了很多搜索但失败了。

这是错误:

错误状态:在没有注册事件处理程序的情况下调用 add(FetchArticlesEvent)。

flutter

13
推荐指数
2
解决办法
2万
查看次数

标签 统计

flutter ×1