simply_wifi 1.0.5 copy "simply_wifi: ^1.0.5" to clipboard
simply_wifi: ^1.0.5 copied to clipboard

discontinued

A simplified version of the Wifi Iot package to make connecting, disconnecting and a lot of things related to wifi easier in flutter.

example/main.dart

import 'package:simply_wifi/simply_wifi.dart';
import 'package:wifi_iot/wifi_iot.dart';

Future<void> main() async {
  // Must call before doing anything else
  // It takes location permission on the run time
  // also does some unknown things :/
  SimplyWifi.init();

  // To turn on wifi dynamically
  SimplyWifi.turnOnWifi();

  // To turn off wifi dynamically
  SimplyWifi.turnOffWifi();

  // To get the list of Wifis
  List<WifiNetwork> _wifiNetworks = await SimplyWifi.getListOfWifis();

  // To connect a wifi from _wifiNetworks list by index
  int indexNumber = 0;
  String passwordOfTheWifi = "I-dont-know";
  SimplyWifi.connectWifiByIndex(indexNumber, password: passwordOfTheWifi);

  // To connect a wifi by its name ( SSID )
  String wifiName = "WifiName";
  SimplyWifi.connectWifiByName(wifiName, password: passwordOfTheWifi);

  // To disconnect the wifi
  SimplyWifi.disconnectWifi();

  // To forget a wifi from _wifiNetworks list by index
  SimplyWifi.forgetWifiByIndex(0);

  // To forget a wifi by name ( SSID )
  SimplyWifi.forgetWifiByWifiName("Name");

  // And that's it my friend :)
}
21
likes
40
pub points
41%
popularity

Publisher

unverified uploader

A simplified version of the Wifi Iot package to make connecting, disconnecting and a lot of things related to wifi easier in flutter.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter, wifi_iot

More

Packages that depend on simply_wifi