authenticateCustomer method

  1. @override
Future<bool> authenticateCustomer({
  1. required String email,
  2. required String password,
})
override

Authenticate customer with email and password.

Implementation

@override
Future<bool> authenticateCustomer({
  required String email,
  required String password,
}) async {
  try {
    final result = await methodChannel.invokeMethod<bool>('authenticateCustomer', {
      'email': email,
      'password': password,
    });

    if (result == true) {
      // Get token after successful authentication
      _customerToken = await methodChannel.invokeMethod<String>('getCustomerToken');
    }

    return result ?? false;
  } catch (e) {
    _error = e.toString();
    return false;
  }
}