diff --git a/CHANGELOG.md b/CHANGELOG.md index 26af231..bae68d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,4 +13,8 @@ ## 1.0.3 -- change listen method signature -- now returns the subscription \ No newline at end of file +- change listen method signature -- now returns the subscription + +## 1.0.4 + +- fix small formatting issues \ No newline at end of file diff --git a/example/reverse_beacon_example.dart b/example/reverse_beacon_example.dart index dc0514c..8184e11 100644 --- a/example/reverse_beacon_example.dart +++ b/example/reverse_beacon_example.dart @@ -19,7 +19,7 @@ void main() async { exit(-1); } int spotCount = 0; - rb.listen((spot) { + var subscription = rb.listen((spot) { //filter if (spotCount < 5) { if (spot.band == Band.meters20 && spot.mode == Mode.cw) { @@ -34,9 +34,12 @@ void main() async { spotCount++; } } - - if (spotCount == 10) { - rb.close(); - } }); + if (spotCount > 15){ + subscription.pause(); + Future.delayed(Duration(seconds: 1)); + subscription.resume(); + subscription.cancel(); + rb.close(); + } } diff --git a/lib/reverse_beacon.dart b/lib/reverse_beacon.dart index d0cab55..5c7d32a 100644 --- a/lib/reverse_beacon.dart +++ b/lib/reverse_beacon.dart @@ -1,4 +1,3 @@ - library; export 'package:reverse_beacon/reverse_beacon.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index a8cdaaf..b413063 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: reverse_beacon description: transforms the reverse beacon telnet CW and DIGI servers into a controllable stream -version: 1.0.3 +version: 1.0.4 repository: https://github.com/N1BRI/reverse_beacon environment: