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

outdated

A Flutter plugin for read SIM information. You can get SIM data for MCC, MNC, country code, etc There are similarities and differences between the data available on Android and iOS. Read the usage.

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();
    getUsimInfo();
  }

  Future<void> getUsimInfo() 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'),
          ],
        )),
      ),
    );
  }
}
29
likes
0
pub points
74%
popularity

Publisher

unverified uploader

A Flutter plugin for read SIM information. You can get SIM data for MCC, MNC, country code, etc There are similarities and differences between the data available on Android and iOS. Read the usage.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on sim_info