getCustomer static method
get Customer info
Callback to get Customer on success Throw ErrorModel if there is some error during the processs
Implementation
static void getCustomer(Function(Customer customer)? onSuccess,
Function(ErrorModel error)? onError) async {
await _indigitall
.invokeMethod(_ACTION_GET_CUSTOMER)
.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))
}
});
}