wifi_scan_desktop 0.0.4 copy "wifi_scan_desktop: ^0.0.4" to clipboard
wifi_scan_desktop: ^0.0.4 copied to clipboard

outdated

Flutter plugin to scan for nearby visible WiFi access points in windows and macosx

example/lib/main.dart

import 'dart:core';

import 'package:flutter/material.dart';
import 'package:wifi_scan_desktop/wifi_info.dart';
import 'package:wifi_scan_desktop/wifi_scan_desktop.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List<WifiInfo> availableNetworks = [];
  final WifiScanDesktop _wifiScanWindowsPlugin = WifiScanDesktop();

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
          actions: [
            ElevatedButton(
                onPressed: () async {
                  List<WifiInfo>? result =
                      await _wifiScanWindowsPlugin.getAvailableNetworks();
                  setState(() {
                    availableNetworks = result ?? [];
                  });
                },
                child: const Text("Get networks")),
          ],
        ),
        body: Column(
          children: [
            Expanded(
              child: ListView.builder(
                itemCount: availableNetworks.length,
                itemBuilder: (context, index) {
                  return ListTile(
                    title: Text('SSID: ${availableNetworks[index].ssid}'),
                    subtitle: Text('RSSI: ${availableNetworks[index].rssi}'),
                  );
                },
              ),
            ),
          ],
        ),
        floatingActionButton: FloatingActionButton.extended(
            onPressed: () async {
              _wifiScanWindowsPlugin.performScan((data) async {
                debugPrint("Scan Completed $data");
              }, (error) {
                debugPrint(error);
              });
            },
            label: const Text('Scan')),
      ),
    );
  }
}
6
likes
0
points
46
downloads

Publisher

verified publisherdregmorr.com

Weekly Downloads

Flutter plugin to scan for nearby visible WiFi access points in windows and macosx

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on wifi_scan_desktop