getMobileNumbers method

  1. @override
Future<SimPickerCallbackResult> getMobileNumbers()
override

Implementation

@override
Future<SimPickerCallbackResult> getMobileNumbers() async {
  final numberHint = await methodChannel.invokeMethod('getMobileNumbers');
  Map<String, dynamic> object = jsonDecode(numberHint);
  switch (object["code"] as int) {
    case 200:
      return SimPickerSuccessState(data: SimNumber.fromJson(object));
    default:
      return SimPickerErrorState(
        errorMessage: object["errorMessage"],
        errorCode: object["code"],
      );
  }
}