charge method

void charge(
  1. double amount
)

Implementation

void charge(double amount) {
  final UUserResponse? u = selectedUser.value;
  if (u == null) return;
  ULoading.show();
  UServices.wallet.charge(
    p: UWalletChargeParams(userId: u.id, amount: amount),
    onOk: (UEmptyResponse r) {
      ULoading.dismiss();
      okCallback(r.message, read);
    },
    onError: (UEmptyResponse e) {
      ULoading.dismiss();
      errorCallBack(e.message, read);
    },
    onException: (String e) {
      ULoading.dismiss();
      UToast.error(message: e);
    },
  );
}