sim_info 0.1.3 copy "sim_info: ^0.1.3" to clipboard
sim_info: ^0.1.3 copied to clipboard

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:sim_info/sim_info.dart';

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

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

class _MyAppState extends State<MyApp> {
  String _allowsVOIP;
  String _carrierName;
  String _isoCountryCode;
  String _mobileCountryCode;
  String _mobileNetworkCode;

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

  Future<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;

    setState(() {
      _allowsVOIP = allowsVOIP;
      _carrierName = carrierName;
      _isoCountryCode = isoCountryCode;
      _mobileCountryCode = mobileCountryCode;
      _mobileNetworkCode = mobileNetworkCode;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('USIM Infomation Plugin'),
        ),
        body: Center(
            child: Column(
          children: <Widget>[
            Text('VOIP : $_allowsVOIP '),
            Text('CarrierName : $_carrierName'),
            Text('ISO CountryCode : $_isoCountryCode'),
            Text('Mobile CountryCode : $_mobileCountryCode'),
            Text('Mobile NetworkCode : $_mobileNetworkCode'),
          ],
        )),
      ),
    );
  }
}
28
likes
40
pub points
72%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on sim_info