I’m developing a country-city-like system. I’m pulling the data with json via phpmyadmin. but even if the system is working, it crashes from time to time. someone who lives and can solve it, urgently need a solution please.
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: DropdownButton(
dropdownColor: Colors.white,
value: selectedfakId,
hint: Text("Fakülte Seçin"),
items: datafak?.map((faklist) {
return new DropdownMenuItem(
child: Text(faklist["name"]),
value: faklist["fakulte_id"],
);
}).toList() ??[],
onChanged: (value) {
setState(() {
selectedfakId = value as String?;
});
},
Future fakliste() async {
var url = "https://www.forumuni.com/forumunimob/unilist.php?send=faklist";
// ignore: unused_local_variable
var response = await http.post(Uri.parse(url),
body: {"uniid": selectedId}, headers: {"Accept": "application/json"});
var jsonbody = response.body;
var jsondata = json.decode(jsonbody);
setState(() {
datafak = jsondata;
});
// ignore: avoid_print
print(jsondata);
return "success";
}
I think I explained it very clearly when you look at the images.
