title: How to create a dynamic ListView in Flutter?
body: <p>I am attempting use TileList passed into ListView.Builder but receive the error: error: The argument type '(BuildContext, int, Items) → Card' can't be assigned to the parameter type '(BuildContext, int) → Widget'. (argument_type_not_assignable).</p>
  
  <p>I have defined _makeCard and _makeTyle as a widget with no success.</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter/painting.dart';
  import 'package:app_settings/app_settings.dart';
  import 'package:coffee/models/settings_items.dart';
  
  class Selections extends StatefulWidget {
  
    @override
    State&lt;Selections&gt; createState() =&gt; _Selections();
    final List&lt;String&gt; menu;
    Selections(this.menu);
  
  }
  
  class _Selections extends State&lt;Selections&gt; {
  
    List items;
  
    @override
    void initState() {
      items = getItems();
      super.initState();
    }
  
   Card _makeCard(BuildContext context, int index, Items item) {
      return Card(
        elevation: 8.0,
        margin: new EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0),
        child: Container(
          decoration: BoxDecoration(color: Color.fromRGBO(64, 75, 96, .0)),
          child: _buildMenu(context, index, item),
        ),
      );
    }
  
  
    ListTile _buildMenu(BuildContext context, int index, Items item) {
    return ListTile(
        contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
        leading: Container(
          padding: EdgeInsets.only(right: 12.0),
          decoration: new BoxDecoration(
            border: new Border(
              right: new BorderSide(width: 1.0, color: Colors.blue),
            ),
          ),
          child: Icon(
            Icons.location_on,
            color: Colors.redAccent,
          ),
        ),
        title: Text(
          item.title,
          style: TextStyle(color: Colors.blue, fontWeight: FontWeight.bold),
        ),
        onTap: () {
          AppSettings.openLocationSettings();
        },
      );
  }
  
    @override
    Widget build(BuildContext context) {
      return Container(
        child: ListView.builder(
            itemBuilder: _makeCard,
            itemCount: 2,
            scrollDirection: Axis.vertical,
            shrinkWrap: true),
      );
    }
  
    List getItems() {
      return [
        Items(
            title: "Turn on Location Services!"
        ),
        Items(
            title: "My Profile"
        ),
      ];
    }
  
  
  }
  </code></pre>
  
  <p>Two ListTIles will be displayed: one with the text "Turn on Location Services" and the other with "My Profile".</p>