createCustomer method

  1. @override
Future<Map<String, dynamic>?> createCustomer({
  1. required String email,
  2. required String password,
  3. required String firstName,
  4. required String lastName,
})
override

Create a new customer account.

Registers a new customer in the Magento system with the provided information.

email the customer's email address (must be unique) password the customer's password firstName the customer's first name lastName the customer's last name

Returns a map containing the created customer data, or null if creation failed.

Implementation

@override
Future<Map<String, dynamic>?> createCustomer({
  required String email,
  required String password,
  required String firstName,
  required String lastName,
}) async {
  try {
    final result = await methodChannel
        .invokeMethod<Map<String, dynamic>>('createCustomer', {
          'email': email,
          'password': password,
          'firstName': firstName,
          'lastName': lastName,
        });
    return result;
  } catch (e) {
    _error = e.toString();
    return null;
  }
}