搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.2

sim_card_info

用於存取SIM卡詳細資訊(例如電信業者名稱、電話號碼和國家代碼)的Flutter外掛程式,非常適合電信相關應用。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1680
喜歡數
29
Pub 分數
140

安裝套件

flutter pub add sim_card_info

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

sim_card_info 套件是一個 Flutter 插件,可在多個平台存取 SIM 卡詳細資料,例如電信商名稱、電話號碼與國家代碼。此套件專為需要即時 SIM 資料的通訊相關應用開發人員設計。支援 Android、iOS、Web、macOS、Windows 與 Linux,確保廣泛相容性。透過簡單的 API,可簡化需要使用者行動網路資訊之應用的整合。該套件透過平台通道利用原生平台功能,在取得權限時提供可靠資料。

適用情境

  • 電信應用開發
  • 透過電話號碼檢測進行使用者引導
  • 基於載體的服務個性化
  • SIM卡驗證工作流程
  • 行動網路診斷

主要特色

  • 存取業者名稱
  • 取得電話號碼
  • 提供國家代碼
  • 跨平台支援
  • 簡單的 API 結合
  • 權限感知設計

適合對象

  • 開發電信應用的開發者
  • 需要基於SIM卡的使用者識別之應用程式
  • 多平台行動應用程式
  • 需要網路運營商資訊的服務

使用建議

  • Android 與 iOS 需要執行時權限
  • 部分裝置上資料的可用性有限
  • Web 支援可能有限制
  • 隱私合規需求
  • 並非所有硬體設定皆可使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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.

所屬分類

依賴

依賴清單 1 項

  • plugin_platform_interface^2.1.8

原始碼儲存庫

使用此套件的專案

暫無相關資料。