assignOrUpdateValueToCustomerFields static method
void
assignOrUpdateValueToCustomerFields(
- Map fields,
- dynamic onSuccess(
- Customer customer
- dynamic onError(
- ErrorModel error
edit or update customer fields
Callback to get Customer on success Throw ErrorModel if there is some error during the processs
Implementation
static void assignOrUpdateValueToCustomerFields(
Map fields,
Function(Customer customer)? onSuccess,
Function(ErrorModel error)? onError) async {
await _indigitall
.invokeMethod(_ACTION_UPDATE_VALUE_CUSTOMER_FIELDS, fields)
.then((value) => {
if (value != null)
{
value.forEach((key, valueMap) {
if (key == _CALLBACK_CUSTOMER) {
if (onSuccess != null) onSuccess(new Customer(valueMap));
}
})
}
})
.catchError((error) => {
if (error is PlatformException)
{
if (onError != null)
onError(ErrorModel(error.code, error.message))
}
});
}