custom_ping 0.2.3+1 copy "custom_ping: ^0.2.3+1" to clipboard
custom_ping: ^0.2.3+1 copied to clipboard

A ping service to fix the ping issue on Colombia networks. Where a valid ping donsnt mean the phone will have navigation

example/lib/main.dart

import 'dart:async';

import 'package:custom_ping/custom_ping.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(Example());
}

class Example extends StatefulWidget {
  @override
  _ExampleState createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  String service = 'No call';
  late StreamSubscription subscription;
  int pingCount = 0;

  @override
  void initState() {
    subscription = PingService().getSubscription(callBack: (e) {
      setState(() {
        pingCount++;
        service = 'Ping has connection $e,  count: $pingCount';
      });
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Custom Ping',
      home: Scaffold(
        body: SafeArea(
          child: Center(
            child: Text(service),
          ),
        ),
      ),
    );
  }

  @override
  dispose() {
    subscription.cancel();
    super.dispose();
  }
}
10
likes
130
pub points
67%
popularity

Publisher

unverified uploader

A ping service to fix the ping issue on Colombia networks. Where a valid ping donsnt mean the phone will have navigation

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, http

More

Packages that depend on custom_ping