{"id":32267931,"url":"https://github.com/fuadreza/online_offline","last_synced_at":"2026-02-19T21:03:38.784Z","repository":{"id":308691309,"uuid":"1033761622","full_name":"fuadreza/online_offline","owner":"fuadreza","description":"⚙️Flutter package for monitoring internet connectivity in real-time using socket connection","archived":false,"fork":false,"pushed_at":"2025-09-19T17:28:47.000Z","size":98,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-03T09:10:16.006Z","etag":null,"topics":["android","connection-checker","flutter","flutter-package","flutter-socket","ios","macos","windows"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/online_offline","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fuadreza.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-07T09:57:59.000Z","updated_at":"2025-09-19T17:27:58.000Z","dependencies_parsed_at":"2025-08-07T10:40:11.908Z","dependency_job_id":"c3b506de-e288-4882-aaa1-6d51e378dbaf","html_url":"https://github.com/fuadreza/online_offline","commit_stats":null,"previous_names":["fuadreza/online_offline"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fuadreza/online_offline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadreza%2Fonline_offline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadreza%2Fonline_offline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadreza%2Fonline_offline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadreza%2Fonline_offline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuadreza","download_url":"https://codeload.github.com/fuadreza/online_offline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuadreza%2Fonline_offline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29632708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","connection-checker","flutter","flutter-package","flutter-socket","ios","macos","windows"],"created_at":"2025-10-22T22:05:19.617Z","updated_at":"2026-02-19T21:03:38.775Z","avatar_url":"https://github.com/fuadreza.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Online Offline Flutter Package\n\n[![pub.dev](https://img.shields.io/pub/v/online_offline.svg)](https://pub.dev/packages/online_offline)\n[![GitHub stars](https://img.shields.io/github/stars/fuadreza/online_offline.svg?style=social)](https://github.com/fuadreza/online_offline)\n\n## Description\n\nA robust Flutter package for monitoring internet connectivity in real-time. \nUnlike traditional connectivity checkers that only verify network interface status, \n`online_offline` performs actual socket connections to ensure true internet availability.\n\nThis package:\n- Uses socket connections to verify real internet connectivity (not just network interface status)\n- Efficiently manages resources by pausing checks when the app is in background\n- Provides easy-to-use widgets for handling online/offline UI states\n- Offers customizable check intervals, timeouts, and hosts\n\n## Installation\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  online_offline: ^latest_version\n```\n\nThen run:\n\n```bash\nflutter pub get\n```\n\nOr using command line:\n\n```bash\nflutter pub add online_offline\n```\n\n## Usage\n\n### Basic Usage\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:online_offline/online_offline.dart';\n\nvoid main() {\n  runApp(const MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  const MyApp({Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    // Create a connection service instance\n    final connectionService = ConnectionService();\n    \n    return MaterialApp(\n      home: Scaffold(\n        appBar: AppBar(title: const Text('Online Offline Demo')),\n        body: Center(\n          child: OnlineOffline(\n            connectionService: connectionService,\n            onlineWidget: const Text('You are online!', style: TextStyle(color: Colors.green, fontSize: 24)),\n            offlineWidget: const Text('You are offline!', style: TextStyle(color: Colors.red, fontSize: 24)),\n            onConnectionChange: (isOnline) {\n              // Handle connection status changes\n              print('Connection status changed: ${isOnline ? 'Online' : 'Offline'}');\n            },\n          ),\n        ),\n      ),\n    );\n  }\n}\n```\n\n### Customizing Connection Service\n\n```dart\n// Create a custom connection service with specific configuration\nfinal connectionService = ConnectionService(\n  host: 'google.com',  // Google Domain (default: 8.8.8.8)\n  port: 80,         // TCP port (default: 53)\n  timeoutDuration: const Duration(seconds: 3),\n  checkInterval: const Duration(seconds: 10),\n  enableDebugLogging: true,\n);\n```\n\n### Accessing Connection Status Directly\n\n```dart\n// Check current status\nbool currentStatus = connectionService.isOnline.value;\n\n// Listen for changes\nconnectionService.isOnline.addListener(() {\n  print('Connection changed: ${connectionService.isOnline.value}');\n});\n\n// Remember to dispose the service when no longer needed\n@override\nvoid dispose() {\n  connectionService.dispose();\n  super.dispose();\n}\n```\n\n## Complete example link\n\nFor a comprehensive demonstration of all features, check out the [example project](https://pub.dev/packages/online_offline/example)\n\n## Contributing\n\nContributions are welcome! If you'd like to contribute, please:\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuadreza%2Fonline_offline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuadreza%2Fonline_offline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuadreza%2Fonline_offline/lists"}