updateEmail method

Future<bool> updateEmail({
  1. required String email,
  2. bool showUI = true,
})

Returns Future of bool, Initiates the update email flow that allows a user to change their email address and returns if the update is successful

Implementation

Future<bool> updateEmail({required String email, bool showUI = true}) async {
  var params = {'email': email, 'showUI': showUI};

  return sendToProvider(
      method: UserMethod.magic_auth_update_email,
      params: [params]).then((jsMsg) {
    var relayerResponse = RelayerResponse<bool>.fromJson(
        json.decode(jsMsg.message), (json) => json as bool);
    return relayerResponse.response.result;
  });
}