SignUpRegiFunction method
Future
SignUpRegiFunction({
- dynamic mobNum,
- dynamic deviceid,
- dynamic fname,
- dynamic email,
- dynamic fcmkey,
- 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),
)));
}
}