title: Future<List> to List with Objects in Flutter
body: <p>I recently started with Flutter.
  My App runs a sqflite database and I want to get all the data out of it and show it in a Row Widget in my App.</p>
  <p>I know how to get the data and I know how to build the Widgets.
  I´m so confused, I have no idea how to convert the data that I get from the database to a List (with that I could build my widgets).</p>
  <p>So I get Future List but I need List Drink</p>
  <p>Just look:</p>
  <p>My Object:</p>
  <pre><code>class Drink {
    int id;
    String time;
    int amount;
  
    Drink({this.id, this.time, this.amount});
  }
  </code></pre>
  <p>Database:</p>
  <pre><code>Future _onCreate(Database db, int version) async {
      await db.execute('''
            CREATE TABLE $table (
              $columnId INTEGER PRIMARY KEY,
              $columnTime TEXT NOT NULL,
              $columnAmount INTEGER NOT NULL
            )
            ''');
    }
  </code></pre>
  <p>How I get the output:</p>
  <pre><code>Future&lt;List&gt; raw() async {
      Database db = await instance.database;
      var dbClient = await db;
      var result = await dbClient.rawQuery(&quot;SELECT * FROM $table&quot;);
      List&lt;Map&lt;String, dynamic&gt;&gt; r = result.toList();
      return r;
    }
  </code></pre>