FLUTTER ECOSYSTEM

data_connection_checker

A pure Dart library that checks for internet by opening a socket to a list of specified addresses, each with individual port and timeout. Defaults are provided for convenience.

Latest version
0.3.4
30-day downloads
516
Likes
423
Pub points
30

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

A pure Dart library that determines internet connectivity by attempting to open sockets to a configurable list of addresses, each with custom ports and timeouts. It provides default settings for quick setup while allowing fine-grained control. Ideal for apps needing reliable network status detection without relying on platform-specific APIs. The library operates asynchronously and is lightweight, making it suitable for real-time connectivity monitoring in Flutter applications.

Use cases
  • Checking internet availability before API calls
  • Monitoring network status in background tasks
  • Validating connection before data synchronization
  • Implementing offline mode logic
  • Providing user feedback on connectivity status
Key features
  • Socket-based connectivity checks
  • Configurable host addresses and ports
  • Customizable timeout settings
  • Default configurations for ease of use
  • Asynchronous operation with callbacks
Suitable for
  • Flutter apps requiring robust network detection
  • Apps with frequent network requests
  • Developers seeking cross-platform consistency
  • Applications needing precise control over connection tests
  • Projects avoiding platform-specific code
Considerations
  • Requires internet access to function correctly
  • May trigger false negatives during transient network issues
  • Does not verify actual internet reachability beyond socket connection
  • Limited to TCP connectivity checks
  • No built-in retry mechanisms
Supported platformsNot available

Install package

flutter pub add data_connection_checker

Categories

Source repository

Related projects