Closed r3a1d3a1 closed 1 year ago
You can just grab the first ping like this:
import 'package:dart_ping/dart_ping.dart';
void main() async {
// Create ping object with desired args
final ping = Ping('google.com', count: 1);
final result = await ping.stream.first;
}
Even shorter:
final result = await Ping('google.com', count: 1).stream.first;
That's good enough for me; Thank you!
I've added this to the documentation for the future. Thanks
Excellent 👍
Hello,
It'd be great not to rely on a stream if one needs to do a single Ping.
Thank you!