createAccount static method

dynamic createAccount({
  1. String name = "",
  2. String email = "",
  3. String phone = "",
  4. String password = "",
  5. String? captcha,
  6. String? gtoken,
  7. String? fbtoken,
  8. String? appletoken,
})

Implementation

static createAccount(
    {String name = "",
    String email = "",
    String phone = "",
    String password = "",
    String? captcha,
    String? gtoken,
    String? fbtoken,
    String? appletoken}) async {
  String url = "${AppUrls.baseUrlVSMS}/subscriberv2/v1/subscriber";
  await DeviceRegistration().getDeviceInformation();
  var body = {
    "subscribername": name.isEmpty ? null : name,
    "country": DeviceInfo.countryCode,
    "password": password.isEmpty ? null : password,
    "captcha": captcha ?? "",
    "deviceos": DeviceInfo.deviceos,
    "model": DeviceInfo.devicemodel,
    "email": email.isEmpty ? null : email,
    "mobileno": phone.isEmpty ? null : phone,
    "make": DeviceInfo.devicemodel,
    "version": DeviceRegistration.appversion,
    "devicetype": DeviceInfo.devicetype,
    "gtoken": gtoken,
    "fbtoken": fbtoken,
    "appletoken": appletoken,
  };
  final response = await _dio!.post(url, data: body);
  var data = response.data;
  return data;
}