simple_wifi_info 1.0.2 copy "simple_wifi_info: ^1.0.2" to clipboard
simple_wifi_info: ^1.0.2 copied to clipboard

A Wifi Info plugin for Flutter.

simple_wifi_info #

Description #

This package is used to get the ssid and bssid of the wifi that the device is connected to.

Usage #

import 'package:simple_wifi_info/wifi_info.dart';

Future<void> getWifiInfo() async {
    WifiInfoModel? wifiInfo;
    try {
      final _wifiInfoPlugin = WifiInfo();
      wifiInfo = await _wifiInfoPlugin.getWifiInfo();
    } on PlatformException {
      wifiInfo = null;
    }
  }

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  simple_wifi_info: ^1.0.0
  • For Android, add the following permissions to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  • For iOS, add the following permissions to your Info.plist file:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used to get the SSID of the connected wifi</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Used to get the SSID of the connected wifi</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Used to get the SSID of the connected wifi</string>

You must enable Wifi-Entitlement by going to Target->Signing & Capabilities and adding Access WiFi Information or adding

Note: Package only works on physical devices

6
likes
140
points
111
downloads

Publisher

unverified uploader

Weekly Downloads

A Wifi Info plugin for Flutter.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on simple_wifi_info