title: Flutter - How to fetch and display data from Phpmyadmin in Flutter
body: <p>I am currently facing a problem with Flutter. I'am a Newbie and...</p>
  
  <p>I want to display data from my Phpmyadmin database in a ListView. This is my Flutter code:</p>
  
  <p>Thanks for helping me!</p>
  
  <pre><code>import 'dart:async';
  import 'dart:convert';
  
  import 'package:flutter/material.dart';
  import 'package:http/http.dart' as http;
  
  void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: new HomePage(),
      );
    }
  }
  
  
  class HomePage extends StatefulWidget {
    @override
    HomePageState createState() =&gt; new HomePageState();
  }
  
  class HomePageState extends State&lt;HomePage&gt; {
  
    List data;
  
    Future&lt;String&gt; getData() async {
      var response = await http.get(
        Uri.encodeFull("https://api.myjson.com/bins/qzvwt"),
        headers: {
          "Accept": "application/json"
        }
      );
  
      this.setState(() {
        data = json.decode(response.body);
      });
  
      print(data[1]["title"]);
  
      return "Success!";
    }
  
    @override
    void initState(){
      this.getData();
    }
  
    @override
    Widget build(BuildContext context){
      return new Scaffold(
        appBar: new AppBar(title: new Text("Listviews"), backgroundColor: Colors.blue),
        body: new ListView.builder(
          itemCount: data == null ? 0 : data.length,
          itemBuilder: (BuildContext context, int index){
            return new Card(
              child: new Text(data[index]["body"]),
            );
          },
        ),
      );
    }
  }
  
  </code></pre>
  
  <p>And my Database Table user_profile: </p>
  
  <p>Table: user_profile</p>
  
  <p>| id  |  name         |  job        |  city       |  iconurl                                                         </p>