Jonatas

update to 3.25.3

## [3.25.3]
- Fix bindStream error 'Object.noSuchMethod'.
## [3.25.2]
- Improved Workers system to accept a list of works
... ...
... ... @@ -116,7 +116,9 @@ mixin RxObjectMixin<T> on NotifyManager<T> {
/// Closing the subscription will happen automatically when the observer
/// Widget ([GetX] or [Obx]) gets unmounted from the Widget tree.
void bindStream(Stream<T> stream) {
_subscriptions[subject].add(stream.listen((va) => value = va));
final listSubscriptions =
_subscriptions[subject] ??= <StreamSubscription>[];
listSubscriptions.add(stream.listen((va) => value = va));
}
}
... ...
name: get
description: Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX.
version: 3.25.2
version: 3.25.3
homepage: https://github.com/jonataslaw/getx
environment:
... ...
import 'dart:async';
import 'package:flutter_test/flutter_test.dart';
import 'package:get/get.dart';
... ... @@ -77,4 +79,20 @@ void main() {
await Future.delayed(Duration(milliseconds: 100));
expect(5, result);
});
test('bindStream test', () async {
var count = 0;
final controller = StreamController<int>();
final rx = 0.obs;
rx.listen((value) {
count = value;
});
rx.bindStream(controller.stream);
expect(count, 0);
controller.add(555);
await Future.delayed(Duration.zero);
expect(count, 555);
});
}
... ...