sim_card_code 0.2.0
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 #
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
Streamof 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:
License #
MIT — see LICENSE.