wifi_flutter 0.2.0 copy "wifi_flutter: ^0.2.0" to clipboard
wifi_flutter: ^0.2.0 copied to clipboard

PlatformAndroid

A plugin to retrieve the nearby wifi networks for android phones only. Simple and low dependencies.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:wifi_flutter/wifi_flutter.dart';

void main() => runApp(MyApp());

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

class _MyAppState extends State<MyApp> {
  List<Widget> _platformVersion = [];

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ListView.builder(
            itemBuilder: (context, i) => _platformVersion[i],
            itemCount: _platformVersion.length,
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () async {
            final noPermissions = await WifiFlutter.promptPermissions();
            if (noPermissions) {
              return;
            }
            final networks = await WifiFlutter.wifiNetworks;
            setState(() {
              _platformVersion = networks
                  .map((network) => Text(
                      "Ssid ${network.ssid} - Strength ${network.rssi} - Secure ${network.isSecure}"))
                  .toList();
            });
          },
        ),
      ),
    );
  }
}
15
likes
160
points
58
downloads

Publisher

verified publisherweplenish.com

Weekly Downloads

A plugin to retrieve the nearby wifi networks for android phones only. Simple and low dependencies.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on wifi_flutter