title: A value of type 'Future<List>' can't be assigned to a variable of type 'List'
body: <p>I am really newbie in Flutter and SQLite.
  I need to store some data got from a DB into a global variable (in this code it's a local variable just for exemplification) and I don't know:</p>
  <ol>
  <li>where is the best point I can do it (now I put it in the homepage's initState method);</li>
  <li>how I can store future data in a no-future variable.</li>
  </ol>
  <p>Below is the method for the data extraction</p>
  <pre><code>class ObjectRepository {
    ObjectRepository._(); 
    static final ObjectRepository instance = ObjectRepository._();
  
    Future&lt;List&lt;Map&gt;&gt; select(Database db, String tableName, {List&lt;String&gt; fields}) async {
          sql = 'SELECT ' + (fields != null ? fields.toString() : '* ');
          sql = sql + 'FROM $tableName';
      
          final List&lt;Map&gt; list = await db.rawQuery(sql);
      
          return list;
    }
  }
  </code></pre>
  <p>Below is where I put my future&lt;List&lt;Map&gt;&gt; into a List&lt;Map&gt; (I know I can't, in fact the IDE gives me this error <em>A value of type 'Future&lt;List&lt;Map&lt;dynamic, dynamic&gt;&gt;&gt;' can't be assigned to a variable of type 'List&lt;Map&lt;dynamic, dynamic&gt;&gt;'. Try changing the type of the variable, or casting the right-hand type to 'List&lt;Map&lt;dynamic, dynamic&gt;&gt;'</em>.</p>
  <p>I even tried to cast it, but I got a similar issue at run-time <em>&quot;type 'Future&lt;List&lt;Map&lt;dynamic, dynamic&gt;&gt;&gt;' is not a subtype of type 'List&lt;Map&lt;dynamic, dynamic&gt;&gt;' in type cast&quot;</em>.</p>
  <pre><code>class HomePage extends StatefulWidget {
    HomePage({Key key}) : super(key: key);
  
    @override
    _HomePageState createState() =&gt; _HomePageState();
  }
  
  class _HomePageState extends State&lt;HomePage&gt; {
    @override
    void initState() {
      super.initState();
  
      DBProvider.instance.openDB(globalConstants.dbName);
      List&lt;Map&gt; list = ObjectRepository.instance.select(DBProvider.instance.database, 'tCars') as List&lt;Map&gt;;
    }
  
    @override
    void dispose() {
      DBProvider.instance.closeDB();
  
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: CustomAppBar(title: Text('Cars')),
        drawer: CustomDrawer(),
        body: CustomBody(),
      );
    }
  }
  </code></pre>
  <p>Any idea how can I resolve it? Many thanks, folks.</p>