Search packages, repositories and app categories

Package detailsv1.0.2

sim_card_info

Flutter plugin for accessing SIM card details like carrier name, phone number, and country code, ideal for telecom-related apps.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.7K
Likes
29
Pub points
140

Install package

flutter pub add sim_card_info

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The sim_card_info package is a Flutter plugin that enables access to SIM card details such as carrier name, phone number, and country code across multiple platforms. It is designed for developers building telecom-related applications requiring real-time SIM data. The plugin supports Android, iOS, Web, macOS, Windows, and Linux, ensuring broad compatibility. With a straightforward API, it simplifies integration into apps needing user mobile network information. It leverages native platform capabilities through platform channels, providing reliable data when permissions are granted.

Use cases

  • Telecom app development
  • User onboarding with phone number detection
  • Carrier-based service personalization
  • SIM card verification workflows
  • Mobile network diagnostics

Key features

  • Accesses carrier name
  • Retrieves phone number
  • Provides country code
  • Cross-platform support
  • Simple API integration
  • Permission-aware design

Suitable for

  • Developers building telecom apps
  • Apps requiring SIM-based user identification
  • Multi-platform mobile applications
  • Services needing network carrier info

Considerations

  • Requires runtime permissions on Android and iOS
  • Limited data availability on some devices
  • Web support may have restrictions
  • Privacy compliance required
  • Not available on all hardware configurations

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

sim_card_info

A Flutter plugin to get SIM card information.

Features

  • Fetches SIM card information from the device.
  • Handles exceptions and returns appropriate messages.

Getting Started

Installation

Add sim_card_info to your pubspec.yaml file:

dependencies:
  sim_card_info: ^1.0.0

then run flutter pub get in your terminal.

Usage

Import
import 'package:sim_card_info/sim_card_info.dart';
Get SIM card information
final _simCardInfoPlugin = SimCardInfo();
List<SimInfo>? _simInfo;

// Retrieve SIM card information
simCardInfo = await _simCardInfoPlugin.getSimInfo() ?? [];
Handling Exceptions

In cases where retrieving information fails, especially on certain devices like iOS, utilize a try/catch block with a PlatformException:

  Future<void> initSimInfoState() async {
  List<SimInfo>? simCardInfo;
  // Platform messages may fail, so we use a try/catch PlatformException.
  // We also handle the message potentially returning null.
  try {
    simCardInfo = await _simCardInfoPlugin.getSimInfo() ?? [];
  } on PlatformException {
    simCardInfo = [];
    setState(() {
      isSupported = false;
    });
  }

  // If the widget was removed from the tree while the asynchronous platform
  // message was in flight, we want to discard the reply rather than calling
  // setState to update our non-existent appearance.
  if (!mounted) return;
  setState(() {
    _simInfo = simCardInfo;
  });
}

Permissions

refer to example directory for a complete sample app usingsim_card_info plugin.

Issues and feedback

For any issue or feedback please create an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Categories

Dependencies

Dependency list 1 items

  • plugin_platform_interface^2.1.8

Source repository

Projects using this package

No data available yet.