EventBus

作者: Jean_Lina | 来源:发表于2021-09-18 17:35 被阅读0次
监听事件:
第一步: 
 late StreamSubscription stream;

第二步:
 @override
  void initState() {
    super.initState();
    stream = RikiApplication.eventBus.on().listen((event) {
      if (event is RefreshPersonalBgImageEvent) {
        setState(() {
          //widget.arg?.bgImage = _vm.bgImage;
        });
      }
    });
  }
typedef VoidCallback = void Function();

相关文章

网友评论

      本文标题:EventBus

      本文链接:https://www.haomeiwen.com/subject/negegltx.html