Это один из них и самый простой:
Код: Выделить всё
Future insertOpreation() async
{
if (name.text != "" || email.text != "" || university.text != "")
{
try
{
String uri = "http://localhost/dashboard/demo/insert.php";
var res = await http.post(Uri.parse(uri), body: {
"name" : name.text,
"email" : email.text,
"university" : university.text
});
var response = jsonDecode(res.body);
if (response["success"] == "true")
{
print("Inserted Successfully");
}
else
{
print("Some Isssue");
}
}
catch (e)
{
}
}
else
{
print("Please fill all fields");
}
}
10.0.2.2, 10.0.2.2:8000, 127.0.0.1, ip из конфигурации ip
Подробнее здесь: https://stackoverflow.com/questions/786 ... -app-error
Мобильная версия