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

outdated

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'),
          ],
        )),
      ),
    );
  }
}
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 name, etc.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on sim_info