КБ
Size: a a a
КБ
🅵
🅵
КБ
🅵
MyBloc(GeoRepository geoRepository) {
geoRepository.getStream().throttleTime(const Duration(seconds: 5)).forEach((location) => add(UpdateLocation(location)));
}
🅵
🅵
🅵
КБ
🅵
🅵
🅵
StreamSubscription<void> _sub;
MyBloc(GeoRepository geoRepository) {
_sub = Stream<void>.pereodic(const Duration(seconds: 5)).listen((_) async {
add(
UpdateLocation
(await geoRepository.getLocation()));
});
}
@override
void close() => _sub.cancel();
🅵
M
AL
MZ
A