wifi_info_plugin 1.1.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 93

wifi_info_plugin #

Wifi info wrapper android plugin

Getting Started #

This Plugin currently only supports android. IOS implementation to be release soon. Listed are all the supported getter methods to retrieve Network Information on your android device.

Below code exhibits usage of the plugin in a flutter application to retrieve Network info.

import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:wifi_info_plugin/wifi_info_plugin.dart';

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

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

class _MyAppState extends State<MyApp> {
  WifiInfoWrapper _wifiObject;


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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    WifiInfoWrapper wifiObject;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      wifiObject = await  WifiInfoPlugin.wifiDetails;

    }
    on PlatformException{

    }
    if (!mounted) return;

    setState(() {

      _wifiObject = wifiObject;
    });
  }

  @override
  Widget build(BuildContext context) {
   String ipAddress = _wifiObject!=null?_wifiObject.ipAddress.toString():"ip";
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on:'+ ipAddress),
        ),
      ),
    );
  }
}

Below are valid getters on the WifiWrapper Class at instantiation

  • ipAddress
  • routerIp
  • dns1
  • dns2
  • bssId
  • ssid
  • macAddress
  • linkSpeed
  • signalStrength
  • frequency
  • networkId
  • connectionType
  • isHiddenSSid

To help support this package donations are welcome here

paypal

1.1.5 #

  • update Read me

1.1.4 #

  • update Read me

1.1.3 #

  • update Read me

1.1.2 #

  • update Read me

1.1.0 #

  • update Read me

1.0.5 #

  • update reop location

1.0.4 #

  • update description

1.0.3 #

  • add method documentation

1.0.2 #

  • removed unused imports

1.0.1 #

  • release only supports android for accessing Network info via native code.

example/lib/main.dart

import 'package:flutter/services.dart';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:wifi_info_plugin/wifi_info_plugin.dart';

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

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

class _MyAppState extends State<MyApp> {
  WifiInfoWrapper _wifiObject;

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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    WifiInfoWrapper wifiObject;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      wifiObject = await WifiInfoPlugin.wifiDetails;
    } on PlatformException {}
    if (!mounted) return;

    setState(() {
      _wifiObject = wifiObject;
    });
  }

  @override
  Widget build(BuildContext context) {
    String ipAddress =
        _wifiObject != null ? _wifiObject.ipAddress.toString() : "ip";
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on:' + ipAddress),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  wifi_info_plugin: ^1.1.5

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:wifi_info_plugin/wifi_info_plugin.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
86
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]
93
Learn more about scoring.

We analyzed this package on Jul 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform Linux

Because:

  • package:wifi_info_plugin/wifi_info_plugin.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Web

Because:

  • package:wifi_info_plugin/wifi_info_plugin.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Windows

Because:

  • package:wifi_info_plugin/wifi_info_plugin.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform macOS

Because:

  • package:wifi_info_plugin/wifi_info_plugin.dart that declares support for platforms: Android, iOS

Package not compatible with SDK dart

Because:

  • wifi_info_plugin that is a package requiring null.

Dependencies

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