fancylou / fancylou.github.io

fancylou`s blog
2 stars 0 forks source link

Flutter中StreamBuilder的用法 #53

Open fancylou opened 4 years ago

fancylou commented 4 years ago

http://www.muliba.net/flutter/2019/07/19/Flutter%E4%B8%ADStreamBuilder%E7%9A%84%E7%94%A8%E6%B3%95.html

先大概说说Stream的概念,这个Stream就是类似平常大家用的比较多的RxJava、RxSwift等框架的思路,它是一个异步数据的源,它可以接受任何数据,通过StreamController可以给这个Stream添加数据,如果这个Stream有监听者就会接收到数据。代码如下: