We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
am getting otp was called null why because i dono... could anybody suggest me
String otpvalue ; String otpvalue1 = "1234";
void otpvalidateandsubmit() async { if (otpvalidateandsave()) { if (postResult.otp == otpvalue) { Navigator.of(context).push( MaterialPageRoute(builder: (context) => Home()), ); } } }
and another page is below
import 'dart:convert'; import 'dart:async';
import 'package:http/http.dart' as http;
class PostResult { String status; String message; var otp;
PostResult({this.status, this.message, this.otp});
factory PostResult.createPostResult(Map<String, dynamic> object) { return PostResult( status: object['status'], message: object['message'], otp: object['otp'],
);
} static Future connectToAPI(String name, String phone, String referal, String type) async { String apiURL = "http://xx2.1xx.1.x:8xx0/api/user/register"; print(name + phone + referal + type);
var apiResult = await http.post(apiURL,headers:{"Content-Type": "application/json"}, body: json.encode({"name": name, "phone": phone, "referral_code":referal, "register_type":type})); var jsonObject = json.decode(apiResult.body); print(jsonObject); return PostResult.createPostResult(jsonObject);
}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
am getting otp was called null why because i dono... could anybody suggest me
String otpvalue ;
String otpvalue1 = "1234";
void otpvalidateandsubmit() async {
if (otpvalidateandsave()) {
if (postResult.otp == otpvalue) {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => Home()),
);
}
}
}
and another page
is below
import 'dart:convert';
import 'dart:async';
import 'package:http/http.dart' as http;
class PostResult {
String status;
String message;
var otp;
PostResult({this.status, this.message, this.otp});
factory PostResult.createPostResult(Map<String, dynamic> object) {
return PostResult(
status: object['status'],
message: object['message'],
otp: object['otp'],
}
static Future connectToAPI(String name, String phone, String referal, String type) async {
String apiURL = "http://xx2.1xx.1.x:8xx0/api/user/register";
print(name + phone + referal + type);
}
}
The text was updated successfully, but these errors were encountered: