Relative Content

Tag Archive for phpflutterapiwebmobile

how to fetch data from PHP API in flutter app

List userdata = []; Future<void> getStudentData() async { String uri = “http://localhost/dashboard/demo/view.php”; try { var response = await http.get(Uri.parse(uri)); setState(() { userdata = jsonDecode(response.body); }); } catch (e) { print(e); } } @override void initState() { super.initState(); getStudentData(); } Column( children: userdata.map((user) { return Column( children: <Widget>[ ElevatedButton( onPressed: () { }, child: Container( child: […]

How to solve try and catch flutter error with php API

when I use try and catch to use API insert opreation and the opreation inserted successfully but unfortunately the toast message don’t print “signed up successfully”, it print this “Error: ClientException: XMLHttpRequest error., uri=”http://localhost/dashboard/help_me/signup.php” “