摘要: 首先要引用event_bus.dart文件 初始化EventBus全局对象 生成一个event类,也可以用父类event来传递 在需要监听总线的页面添加监视器,类型是StreamSubscription,可以指定监听的event类型,不符合的event不会被监听到 发送事件可以用EventBus.f 阅读全文
posted @ 2020-08-23 00:39 NeoZy 阅读(629) 评论(0) 推荐(0) 编辑
摘要: column和row的children属性可以使用匿名函数来添加。可以省去大量重复代码: Column( mainAxisAlignment: MainAxisAlignment.center, children: (){ var p = List<Widget>(); for(int i=0; i 阅读全文
posted @ 2020-08-23 00:18 NeoZy 阅读(246) 评论(0) 推荐(0) 编辑