internet_connection_checker_service 1.0.5 copy "internet_connection_checker_service: ^1.0.5" to clipboard
internet_connection_checker_service: ^1.0.5 copied to clipboard

A service for checking internet connection status and accessibility

Introduction #

This package provides methods and streams for checking the current internet connection status and whether internet access is available through specified URLs.

Features #

  • Check the current internet connection status: disconnected or connected.
  • Determine the internet connection through specific URLs.

Usage #

To use this package, make sure to include it in your pubspec.yaml file:

dependencies:
  internet_connection_checker_service: ^1.0.5

Example usage:

final internetConnectionChecker = InternetConnectionCheckerService();

List<InternetConnectionOptions> optionURLs = [
    const InternetConnectionOptions(
      uri: 'https://google.com',
      timeout: Duration(seconds: 20),
    ),
    const InternetConnectionOptions(
      uri: 'https://bing.com',
      timeout: Duration(seconds: 20),
    ),
  ];


// Listen to changes in internet connection status.
final subscription = internetConnectionChecker
    .onInternetConnectionStatusChanged(optionURLs: optionURLs)
    .listen((status) {
  // Handle the internet connection status change.
});

// Check if internet access is available through specified URLs.
final hasAccess = await internetConnectionChecker.hasInternetAccess(
  optionURLs: optionURLs,
);

Additional information #

I conducted research on packages that rely on connectivity_plus and noticed that they do not accurately detect changes in internet connectivity. As a result, I decided to develop a new package inspired by internet_connection_checker to address these issues and provide more reliable internet connection change detection.

If you have more specific details or questions related to creating this package or need further assistance, please feel free to ask.

3
likes
0
pub points
53%
popularity

Publisher

unverified uploader

A service for checking internet connection status and accessibility

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

connectivity_plus, dio, flutter

More

Packages that depend on internet_connection_checker_service