enum ConnectivityResult {
bluetooth,
wifi,
ethernet,
mobile,
none
}
final connectivityProvider = StreamProvider<ConnectivityResult>((ref){
...
})
final repoProvider = FutureProvider<List>((ref) async {
ref.watch(
connectivityProvider.selectAsync(
// WHAT DO TO HERE.
(data) => ConnectivityResult.wifi,
),
);
...
});
我只想侦听“ConnectivityResult.wifi”以触发repoProvider的重建。
1条答案
按热度按时间yr9zkbsy1#
感谢Randal的评论和阅读文档后,问题解决了。非常感谢。