sim_card_code 0.2.0 copy "sim_card_code: ^0.2.0" to clipboard
sim_card_code: ^0.2.0 copied to clipboard

A Flutter plugin for accessing SIM card details, phone number country code, network info, eSIM status and multi-SIM information.

sim_card_code #

StandWithPalestine Pub Version License: MIT

A Flutter plugin for SIM card and cellular network info on Android & iOS — country code, operator, network type, eSIM status, multi-SIM and live changes.

Features #

  • SIM — country code, operator, ICCID, phone number, state, eSIM flag
  • Network — operator, country, type, 2G–5G generation, roaming
  • Multi-SIM — count, dual-SIM detection, per-SIM lookup by subscription id
  • Device — device id (IMEI/MEID), hardware eSIM support
  • Live updates — a Stream of SIM / network changes

Install #

dependencies:
  sim_card_code: ^0.2.0

iOS works with both CocoaPods and Swift Package Manager — no setup needed.

Usage #

import 'package:sim_card_code/sim_card_code.dart';

// SIM + network
final country = await SimCardManager.simCountryCode;  // "US"
final net     = await SimCardManager.networkInfo;     // operator, type, generation
final esim    = await SimCardManager.isEsim;

// All SIMs, or one SIM by subscription id (multi-SIM)
final sims = await SimCardManager.allSimInfo;
final one  = await SimCardManager.simInfoForSubscription(sims.first.subscriptionId!);

// Live changes — SIM insert/remove/swap, network/roaming
SimCardManager.onChanged.listen((e) => print('changed: ${e.type}'));

Failures return null by default. Set SimCardManager.throwOnError = true to get a SimCardException instead.

Permissions #

Android — add to AndroidManifest.xml, then request at runtime (e.g. with permission_handler):

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

iOS — no setup. supportsEsim needs the com.apple.developer.esim-access entitlement, otherwise it always returns false.

Platform support #

Platform Min Notes
Android API 21 full support
iOS 13.0 no phone number / IMEI / ICCID / roaming (privacy)

Support #

If this plugin helps you, consider supporting development:

Buy Me A Coffee

License #

MIT — see LICENSE.

12
likes
160
points
1.08k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for accessing SIM card details, phone number country code, network info, eSIM status and multi-SIM information.

Repository (GitHub)
View/report issues

Topics

#sim-card #telephony #esim #carrier #phone-number

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sim_card_code

Packages that implement sim_card_code