SignUpRegiFunction method

Future SignUpRegiFunction({
  1. dynamic mobNum,
  2. dynamic deviceid,
  3. dynamic fname,
  4. dynamic email,
  5. dynamic fcmkey,
  6. dynamic context,
})

Implementation

Future SignUpRegiFunction(
    {mobNum, deviceid, fname, email, fcmkey, context}) async {
  final response = await http.post(
    Uri.parse('${SDK_BASE_URL}claim_adminpanel/claim_api/register'),
    body: {
      "mobile_no": mobNum,
      "device_id": deviceid,
      "name": fname,
      "email": email,
      "source": Platform.isAndroid ? 1.toString() : 2.toString(),
      "fcmkey": fcmkey
    },
  );
  var decodedResponse = json.decode(response.body);
  if (decodedResponse['status'] == true) {
    Get.to(OtpVerify(mobNum: mobNum, deviceid: deviceid));
  } else {
    ScaffoldMessenger.of(context).showSnackBar(SnackBar(
        content: Text(
      "${decodedResponse['message']}"
          .replaceAll('</p>', '')
          .replaceAll('<p>', '')
          .trim(),
      style: TextStyle(
          fontFamily: 'Nunito', fontWeight: FontWeight.w500, fontSize: 14),
    )));
  }
}