androidRestore static method

Future<AWResponseModel<List<AWOrder>>> androidRestore()

Implementation

static Future<AWResponseModel<List<AWOrder>>> androidRestore() async {
  var result = await _channel.invokeMethod('restore');
  final model = getResponseModel(result);
  if (!model.result) {
    return AWResponseModel.sendFailed(model.msg);
  }
  final List<AWOrder> purchaseList = [];
  if (model.data == null) {
    return AWResponseModel.sendSuccess(purchaseList);
  }
  final List purchaseStr = model.data;
  for (var purchaseJson in purchaseStr) {
    purchaseList.add(AWOrder.fromAndroidJson(purchaseJson));
  }
  return AWResponseModel.sendSuccess(purchaseList);
}