android_wifi_info 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

android_wifi_info #

Dart plugin package for accessing Android's WifiInfo from Flutter. Android-only plugin.

This is a Dart plugin package for accessing wifi information from Flutter and Dart. This is an Android-only plugin.

The plugin wraps the WifiInfo class and provides access to all of its methods. It describes the state of any Wifi connection that is active or is in the process of being set up.

References #

The plugin is published on Dart Pub pub.dartlang.org/packages/android_wifi_info

You can read the API reference on Dart Pub.

The source code is available on GitHub smaho-engineering/android_wifi_info.

This Flutter plugin is created by the SMAHO engineering team.

Usage #

import 'package:android_wifi_info/android_wifi_info.dart';

getNetworkInfo() async {
  final bssid = await AndroidWifiInfo.bssid;
  final ssid = await AndroidWifiInfo.ssid;
}

Example app #

For a working example app, see the example directory.

To view example screen record, click here

Documentation #

AndroidWifiInfo Flutter plugin's documentation

Combine with other plugins to access features cross-platform #

This plugin is intentionally supporting only Android. However, this doesn't mean you cannot use this plugin to create your own cross-platform utility module for fetching the details you need for your app.

For example, if you want to fetch the current WiFi's BSSID, you can combine it with ios_network_info package:

import 'dart:io';

import 'package:android_wifi_info/android_wifi_info.dart';
import 'package:ios_network_info/ios_network_info.dart';

get bssid {
  if (Platform.isAndroid) {
    return AndroidWifiInfo.bssid;
  } else if (Platform.isIOS) {
    return IosNetworkInfo.bssid;
  }
  throw Exception('WiFi BSSID is not supported on this platform');
}

To do #

This plugin is very much in progress.

There are some important tasks I'm still planning to do for the 1.x version release.

  • handle enums properly
  • related code, eg converting RSSI to something useful (scale)
  • don't forget to point users to how to convert int values to more traditional representations (ip)
  • Android Q? tx, rx link speed
  • could add links to the right sections in android docs
  • consider adding code snippets to the documentation
  • example app docs contains links and on tap could open the links in browser... but it's a bit of an overkill for an example app
  • make mac address work with proper permissions or at least document it

0.1.1 #

  • Fix br0k3n URL to the Pub

0.1.0 #

  • All WifiInfo methods are implemented except:
    • Android Q
    • methods with enum parameter or return value
  • All of these methods are documented
  • Example app
  • Documentation, READMEs, unit tests are in place

0.0.1 #

  • Initial release.
  • Still lots of todos, missing docs, readmes, examples. For 0.1.x, we'll have all of them

example/README.md

android_wifi_info Example App

Demonstrates how to use the android_wifi_info plugin.

For a working example app, see the example directory.

Just clone the repository and execute flutter run.

To view example screen record, click here

Please keep in mind that this is an Android-only plugin.

Getting Started with Flutter #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  android_wifi_info: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:android_wifi_info/android_wifi_info.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
68
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

We analyzed this package on Nov 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test