deleteValuesFromCustomerFields static method
void
deleteValuesFromCustomerFields(
- List<
String> fieldNames, - dynamic onSuccess(
- Customer customer
- dynamic onError(
- ErrorModel error
delete fields of Customer
Callback to get Customer on success Throw ErrorModel if there is some error during the processs
Implementation
static void deleteValuesFromCustomerFields(
List<String> fieldNames,
Function(Customer customer)? onSuccess,
Function(ErrorModel error)? onError) async {
await _indigitall
.invokeMethod(_ACTION_DELETE_VALUES_CUSTOMER_FIELDS, fieldNames)
.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))
}
});
}