getCustomer method
Get the customer data.
Implementation
@override
Future<Customer> getCustomer({required String customerId}) async {
try {
final result = await methodChannel.invokeMethod<Map<dynamic, dynamic>>(
'getCustomer',
{'customerId': customerId},
);
if (result != null) {
final customerMap = Map<String, dynamic>.from(result);
final customer = Customer.fromMap(customerMap);
return customer;
} else {
throw PlatformException(
code: 'NULL_RESULT',
message: 'getCustomer returned null',
);
}
} on PlatformException {
rethrow;
}
}