customerSummary method Null safety

  1. @override
Future<CustomerSummaryModel> customerSummary(
  1. {required int customerId}
)
override

Use it to get user's profile points and wishlist number

Implementation

@override
Future<CustomerSummaryModel> customerSummary(
    {required int customerId}) async {
  final response = await postData(
    path: 'profile/customerSummary',
    queryParameters: {"CustomerID": customerId},
  );
  final result = ApiReturnResult.fromJSON(response.data);
  if (result.code == 200) {
    return CustomerSummaryModel.fromJson(result.data);
  } else {
    throw ExceptionApi(code: result.code, message: result.error?.first);
  }
}