Bersh / flutter-wifi-connect

Dead simple WiFi connect functionality for flutter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter WiFi Connect

Easily connect to a specified WiFi AP programmatically, using this plugin.

import 'package:wifi_connect/wifi_connect.dart';
WifiConnect.connect(context, 'ssid', 'password');

It's that simple. No fussing with permissions, enabling WiFi, location and all that boring stuff.


var connectedTo = WifiConnect.getConnectedSSID(context);
print('Connected to: $connectedTo');

And behold, the mighty WifiScannerMixin!

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with WifiScannerMixin<MyApp> {
 @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text("Connected to '$connectedSSID'"),
        )       
      )   
    );
  }

  @override
  void initState() {
    super.initState();
    startWifiScanner();
  }
}

About

Dead simple WiFi connect functionality for flutter.

License:Other


Languages

Language:Kotlin 39.3%Language:Dart 32.7%Language:Ruby 14.6%Language:Swift 12.0%Language:Objective-C 1.4%