sim_card_info
通信関連アプリに最適な、キャリア名、電話番号、国コードなどのSIMカード情報を取得するためのFlutterプラグイン。
FadyFouad/sim_card_info open-source repository details.
以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
A Flutter plugin to get SIM card information.
Add sim_card_info to your pubspec.yaml file:
dependencies:
sim_card_info: ^1.0.0
then run flutter pub get in your terminal.
import 'package:sim_card_info/sim_card_info.dart';
final _simCardInfoPlugin = SimCardInfo();
List<SimInfo>? _simInfo;
// Retrieve SIM card information
simCardInfo = await _simCardInfoPlugin.getSimInfo() ?? [];
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;
});
}
refer to example directory for a complete sample app usingsim_card_info plugin.
For any issue or feedback please create an issue.
This project is licensed under the MIT License - see the LICENSE file for details.
依存関係一覧 5 件
{"sdk":"flutter"}{"sdk":"flutter"}^2.1.8{"sdk":"flutter"}^3.0.2用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗