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

outdated

A plugin to retrieve the nearby wifi networks

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
0
pub points
79%
popularity

Publisher

verified publisherweplenish.com

A plugin to retrieve the nearby wifi networks

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on wifi_flutter