sim_info 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

flutter_sim_info #

A Flutter plugin for read SIM information.
You can get SIM data for MCC, MNC, country name, etc...

Note: There are similarities and differences between the data available on Android and iOS. Read the usage.

Usage #

Import the package #

In your flutter project add the dependency:

  sim_info: ^0.1.1

check it out the installing page.

Use the plugin #

Add the following import to your Dart code:

import 'package:sim_info/sim_info.dart';

Use below to get SIM data:

  String _allowsVOIP;
  String _carrierName;
  String _isoCountryCode;
  String _mobileCountryCode;
  String _mobileNetworkCode;

  void initState() {

  void getSimInfo() async {
    String allowsVOIP = await SimInfo.getAllowsVOIP;
    String carrierName = await SimInfo.getCarrierName;
    String isoCountryCode = await SimInfo.getIsoCountryCode;
    String mobileCountryCode = await SimInfo.getMobileCountryCode;
    String mobileNetworkCode = await SimInfo.getMobileNetworkCode;

Full list of available SIM data.

Android integration #

Beginning with Android 6.0 (API level 23), you must obtain bellow permission before using methods.

Dangerous permissions READ_PHONE_STATE

Error message #

"PERMISSION_DENIED" // In android, you use methods before get permission.

"SIM_STATE_NOT_READY" // In both, cannot found SIM card in your device.

Screenshots #


API details #

See the WIKI for more API details.

Issues and feedback #

Please file issues to send feedback or report a bug. Thank you!

License #

MIT license.

0.1.1 #

  • Update

0.1.0 #

  • Add Plugin Test Code
  • Delete a platform branch of a method with the same name

0.0.1 #

  • Initial Release


sim_info_example #

Demonstrates how to use the sim_info plugin.

Getting Started #

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:

  sim_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:sim_info/sim_info.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health issues and suggestions

Document public APIs. (-1 points)

8 out of 8 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/sim_info.dart. (-0.50 points)

Analysis of lib/sim_info.dart reported 1 hint:

line 2 col 8: Unused import: 'dart:io'.


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.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies