getSimInfo method

  1. @override
Future<List<SimInfo>?> getSimInfo()
override

Implementation

@override
Future<List<SimInfo>?> getSimInfo() async {
  final info = await methodChannel.invokeMethod<String>('getSimInfo');
  List<SimInfo>? simInfoList;
  if (info != null) {
    simInfoList = [];
    // convert json to list
    final infoJson = json.decode(info);
    infoJson.forEach((element) {
      simInfoList?.add(SimInfo.fromJson(element));
    });
  }
  return simInfoList;
}