{"id":21707329,"url":"https://github.com/marchdev-tk/cross_connectivity","last_synced_at":"2025-04-09T23:16:10.183Z","repository":{"id":48256936,"uuid":"246815753","full_name":"marchdev-tk/cross_connectivity","owner":"marchdev-tk","description":"A Flutter plugin for handling Connectivity and REAL Connection state in the mobile, web and desktop platforms. Supports iOS, Android, Web, Windows, Linux and macOS.","archived":false,"fork":false,"pushed_at":"2024-11-09T15:48:28.000Z","size":2670,"stargazers_count":30,"open_issues_count":4,"forks_count":16,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-09T23:16:03.999Z","etag":null,"topics":["android","connectivity","dart","dart2","dartlang","flutter","flutter-package","flutter-plugin","internet-connection","internet-connection-checker","internet-connectivity","ios","linux","macos","macosx","web","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","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/marchdev-tk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-12T11:21:21.000Z","updated_at":"2024-11-09T15:48:26.000Z","dependencies_parsed_at":"2024-03-04T21:05:21.779Z","dependency_job_id":"1d4745c3-17fd-4b1f-b06a-42599fc0eaa3","html_url":"https://github.com/marchdev-tk/cross_connectivity","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fcross_connectivity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fcross_connectivity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fcross_connectivity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fcross_connectivity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marchdev-tk","download_url":"https://codeload.github.com/marchdev-tk/cross_connectivity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125591,"owners_count":21051770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","connectivity","dart","dart2","dartlang","flutter","flutter-package","flutter-plugin","internet-connection","internet-connection-checker","internet-connectivity","ios","linux","macos","macosx","web","windows"],"created_at":"2024-11-25T22:17:06.173Z","updated_at":"2025-04-09T23:16:10.158Z","avatar_url":"https://github.com/marchdev-tk.png","language":"C++","readme":"# cross_connectivity\n\n![Build](https://github.com/marchdev-tk/cross_connectivity/workflows/build/badge.svg)\n[![Pub](https://img.shields.io/pub/v/cross_connectivity.svg)](https://pub.dartlang.org/packages/cross_connectivity)\n![GitHub](https://img.shields.io/github/license/marchdev-tk/cross_connectivity)\n![GitHub stars](https://img.shields.io/github/stars/marchdev-tk/cross_connectivity?style=social)\n\nA Flutter plugin for handling `Connectivity` and `REAL Connection` state in the mobile, web and desktop platforms. Supports iOS, Android, Web, Windows, Linux and macOS.\n\n## Getting Started\n\nIn order to use this plugin, add dependency in the `pubspec.yaml`:\n\n```yaml\ncross_connectivity: any\n```\n\nor\n\n```yaml\ncross_connectivity:\n    git:\n      url: https://github.com/marchdev-tk/cross_connectivity\n```\n\nAdd an import to dart file:\n\n```dart\nimport 'package:cross_connectivity/cross_connectivity.dart';\n```\n\n### Samples\n\nWeb sample:\n\n![Web Sample](../assets/cc_web.gif?raw=true)\n\nDesktop sample:\n\n![Desktop Sample](../assets/cc_desktop.gif?raw=true)\n\nMobile sample:\n\n![Mobile Sample](../assets/cc_mobile.gif?raw=true)\n\n### Usage\n\n#### Functional approach\n\nThis plugin provides two streams:\n\n * `isConnected` that shows whether the device is `REALLY` connected to the network or not.\n * `onConnectivityChanged` that it will not let you know about state of the `REAL` network connection. It only shows connectivity state.\n\nAlso for `one time` check could be used following methods:\n\n * `checkConnection()` that is working like `isConnected`, but returns `Future\u003cbool\u003e` instread of `Stream\u003cbool\u003e`.\n * `checkConnectivity()` that is working like `onConnectivityChanged`, but returns `Future\u003cConnectivityStatus\u003e` instread of `Stream\u003cConnectivityStatus\u003e`.\n\nThere are no more methods (they are working only on Android/iOS/macOS):\n\n * `getWifiName()`  - Obtains the wifi name (SSID) of the connected network.\n * `getWifiBSSID()` - Obtains the wifi BSSID of the connected network.\n * `getWifiIP()` - Obtains the IP address of the connected wifi network.\n\nThey are removed to [wifi_info_flutter](https://github.com/flutter/plugins/tree/master/packages/wifi_info_flutter).\n\n##### Migration guide:\n\nIf you don't use any of the above APIs, your code should work as is. In addition, you can also remove `NSLocationAlwaysAndWhenInUseUsageDescription` and `NSLocationWhenInUseUsageDescription` in `ios/Runner/Info.plist`\n\nIf you use any of the above APIs, you can find the same APIs in the [wifi_info_flutter](https://github.com/flutter/plugins/tree/master/packages/wifi_info_flutter/wifi_info_flutter) plugin.\nFor example, to migrate `getWifiName`, use the new plugin:\n```dart\nfinal WifiInfo _wifiInfo = WifiInfo();\nfinal String wifiName = await _wifiInfo.getWifiName();\n  ```\n\n#### Widget approach\n\nAs an alteration to funcitonal approach could be used `ConnectivityBuilder` widget as follows:\n\n```dart\nConnectivityBuilder(\n  builder: (context, isConnected, status) =\u003e Row(\n    mainAxisSize: MainAxisSize.min,\n    children: \u003cWidget\u003e[\n      Icon(\n        isConnected == true\n            ? Icons.signal_wifi_4_bar\n            : Icons.signal_wifi_off,\n        color: isConnected == true ? Colors.green : Colors.red,\n      ),\n      const SizedBox(width: 8),\n      Text(\n        '$status',\n        style: TextStyle(\n          color: status != ConnectivityStatus.none\n              ? Colors.green\n              : Colors.red,\n        ),\n      ),\n    ],\n  ),\n)\n```\n\n## Feature requests and Bug reports\n\nFeel free to post a feature requests or report a bug [here](https://github.com/marchdev-tk/cross_connectivity/issues).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchdev-tk%2Fcross_connectivity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarchdev-tk%2Fcross_connectivity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchdev-tk%2Fcross_connectivity/lists"}