getSimData method

Future<List<SimDataModel>> getSimData()

Supported only for Android! Fetches the SIM data and returns List<SimDataModel>

Implementation

Future<List<SimDataModel>> getSimData() async {
  final res = await SimDataPlatform.instance.getSimData();
  if (res != null) {
    try {
      return jsonDecode(res).map<SimDataModel>((e) {
        return SimDataModel.fromJson(e);
      }).toList();
    } catch (e) {
      throw Exception(e);
    }
  } else {
    return <SimDataModel>[];
  }
}