registerPerson method

Future registerPerson(
  1. String atsign,
  2. String email, {
  3. String? oldEmail,
})

To register the person with the provided atsign and email It will send an OTP to the registered email

Implementation

Future<dynamic> registerPerson(String atsign, String email,
    {String? oldEmail}) async {
  if (!initialized) {
    _init();
  }
  Map<String, String?> data;
  String path = AppConstants.apiPath + AppConstants.registerPerson;
  if (oldEmail != null) {
    data = <String, String?>{
      'email': email,
      'atsign': atsign,
      'oldEmail': oldEmail
    };
  } else {
    data = <String, String?>{'email': email, 'atsign': atsign};
  }

  dynamic response = await postRequest(path, data);
  return response;
}