{"id":22015648,"url":"https://github.com/iconica-development/flutter_connectivity_hook","last_synced_at":"2026-04-14T14:32:46.870Z","repository":{"id":216078128,"uuid":"740410043","full_name":"Iconica-Development/flutter_connectivity_hook","owner":"Iconica-Development","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-14T18:25:22.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T08:47:29.345Z","etag":null,"topics":["component"],"latest_commit_sha":null,"homepage":"","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/Iconica-Development.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-08T09:39:41.000Z","updated_at":"2025-06-19T07:44:51.000Z","dependencies_parsed_at":"2024-02-19T14:28:46.203Z","dependency_job_id":"0636d705-e5d3-4426-bc01-e367fbbb7b63","html_url":"https://github.com/Iconica-Development/flutter_connectivity_hook","commit_stats":null,"previous_names":["iconica-development/flutter_connectivity_hook"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Iconica-Development/flutter_connectivity_hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iconica-Development%2Fflutter_connectivity_hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iconica-Development%2Fflutter_connectivity_hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iconica-Development%2Fflutter_connectivity_hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iconica-Development%2Fflutter_connectivity_hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Iconica-Development","download_url":"https://codeload.github.com/Iconica-Development/flutter_connectivity_hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iconica-Development%2Fflutter_connectivity_hook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31801355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["component"],"created_at":"2024-11-30T04:27:22.341Z","updated_at":"2026-04-14T14:32:46.836Z","avatar_url":"https://github.com/Iconica-Development.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart) \n\nImplementation of [flutter_connectivity](https://github.com/Iconica-Development/flutter_connectivity_hook) in conjuction with [flutter_hooks](https://pub.dev/packages/flutter_hooks)\n\n\n\nPackage that can be used to check for an internet connection in your application\n\nFigma Design that defines this component (only accessible for Iconica developers): https://www.figma.com/file/4WkjwynOz5wFeFBRqTHPeP/Iconica-Design-System?type=design\u0026node-id=516%3A1847\u0026mode=design\u0026t=XulkAJNPQ32ARxWh-1\nFigma clickable prototype that demonstrates this component (only accessible for Iconica developers): https://www.figma.com/proto/4WkjwynOz5wFeFBRqTHPeP/Iconica-Design-System?type=design\u0026node-id=340-611\u0026viewport=-4958%2C-31%2C0.33\u0026t=XulkAJNPQ32ARxWh-0\u0026scaling=min-zoom\u0026starting-point-node-id=516%3A3402\u0026show-proto-sidebar=1\n\n## Setup\n\nSee [example](./example/lib/main.dart) app for a guide\n\nMake sure to also add \n```yaml\nflutter_hooks: ...\n```\nto your pubspec.yaml\n\n## How to use\n\nUsing the default handler for Flutter\n```dart\n  useConnectivity(\n    context: context,\n    fallBackScreen: const NoInternetScreen(),\n  );// Screen to show when no internet has been detected. NoInternetScreen is a screen provided by this package but any can be used.\n);\n``` \nMake sure to call this somewhere in the app where there is a navigator in your context when using the default handler.\n\nConfiguration can be customzied using the following method:\n```dart\n  useConnectivity(\n      context: context,\n      fallBackScreen: const NoInternetScreen(),\n      config: ConnectivityConfig(\n        url: 'www.iconica.nl',\n        handler: CustomHandler(),\n        checker: CustomInternetChecker(),\n      ),\n    );\n```\n\nCustomHandler and CustomInterChecker are implementations of an abstract class, which look something like:\n\n```dart\nclass CustomHandler implements ConnectivityHandler {\n  @override\n  void onConnectionLost() {\n    debugPrint('Connection lost');\n  }\n\n  @override\n  void onConnectionRestored() {\n    debugPrint('Connection restored');\n  }\n}\n```\n\n```dart\nclass CustomInternetChecker implements ConnectivityChecker {\n  @override\n  Future\u003cbool\u003e checkConnection() async {\n    try {\n      var result = await InternetAddress.lookup('google.nl');\n      if (result.isNotEmpty \u0026\u0026 result[0].rawAddress.isNotEmpty) {\n        return true;\n      }\n    } on SocketException catch (_) {\n      return false;\n    }\n    return false;\n  }\n}\n```\n\nWhen using a custom handler, the instance can be started without the context and fallBackScreen parameters\n```dart\n    useConnectivity(\n      config: ConnectivityConfig(\n        url: 'www.iconica.nl',\n        handler: CustomHandler(),\n        checker: CustomInternetChecker(),\n      ),\n    );\n```\n\nFor a complete overview of how to use it look at the [example](./example/lib/main.dart) app\n\n\n## Issues\n\nPlease file any issues, bugs or feature request as an issue on our [GitHub](https://github.com/Iconica-Development/flutter_connectivity_hook) page. Commercial support is available if you need help with integration with your app or services. You can contact us at [support@iconica.nl](mailto:support@iconica.nl).\n\n## Want to contribute\n\nMake sure when updating either [flutter_connectivity](https://github.com/Iconica-Development/flutter_connectivity) or [flutter_connectivity_hook](https://github.com/Iconica-Development/flutter_connectivity_hook) to keep the versioning in sync.\n\nIf you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](./CONTRIBUTING.md) and send us your [pull request](https://github.com/Iconica-Development/flutter_connectivity_hook/pulls).\n\n## Author\n\nThis flutter_connectivity package for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at \u003csupport@iconica.nl\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficonica-development%2Fflutter_connectivity_hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficonica-development%2Fflutter_connectivity_hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficonica-development%2Fflutter_connectivity_hook/lists"}