title: Flutter Setting Default ItemCount on ListView Builder
body: <p>I'm trying to build some input fields with ListView Builder and set the default built fields to 3 then add to the number using the floatActionButtion to generate more fields.</p>
  
  <p>But the 3 default fields i set ain't showing up and I couldn't understand what is happening.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>int newSULength = 3;
  
  new Expanded(
                child: new Form(
                  key: formKey,
                  child: new ListView.builder(
                    itemBuilder: (BuildContext context, int index) {
                      return buildfields(index);
                    },
                    itemCount: newSULength,
                    scrollDirection: Axis.vertical,
                  ),
                ),
              )
  floatingActionButton: new FloatingActionButton(
          onPressed: () {
            setState(() {
              newSULength++;
            });
          },
          child: new Icon(Icons.add),
        )
  </code></pre>
  
  <p>Below is the field am trying to Build.</p>
  
  <pre><code>    Widget buildfields(int index) {
      return new Container(
        margin: EdgeInsets.only(bottom: 10.0),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: &lt;Widget&gt;[
            _deleteMode ? deleteButton(index) : null,
            Container(
              width: 110.0,
              child: TextFormField(
                onSaved: (String value) {
                  setState(() {
                    _course = value;
                  });
                },
                initialValue: 'GNS101',
                inputFormatters: [
                  new LengthLimitingTextInputFormatter(6),
                ],
                validator: (val) {
                  return val.isEmpty ? "Enter Course Code" : null;
                },
                textCapitalization: TextCapitalization.characters,
                decoration: new InputDecoration(
                  border: UnderlineInputBorder(),
                  contentPadding: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 8.0),
                ),
              ),
            ),
            new Container(
              child: new DropdownButton&lt;num&gt;(
                onChanged: (num value) {
                  setState(() {
                    selectedGrade[index] = value;
                  });
                },
                hint: new Text('Grade Point'),
                value: selectedGrade[index],
                items: &lt;num&gt;[0, 1, 2, 3, 4, 5].map((num value) {
                  return new DropdownMenuItem&lt;num&gt;(
                    value: value,
                    child: new Text(value.toString()),
                  );
                }).toList(),
              ),
            ),
            new Container(
              child: new DropdownButton&lt;num&gt;(
                onChanged: (num value) {
                  setState(() {
                    selectedUnit[index] = value;
                  });
                },
                hint: new Text('Course Unit'),
                value: selectedUnit[index],
                items: &lt;num&gt;[1, 2, 3, 4, 5].map((num value) {
                  return new DropdownMenuItem&lt;num&gt;(
                    value: value,
                    child: new Text(value.toString()),
                  );
                }).toList(),
              ),
            ),
          ].where(notNull).toList(),
        ),
      );
    }
  </code></pre>
  
  <p><strong>UPDATE:</strong> I discover that my problem is declaring <code>selectedUnit</code> and <code>selectedGrade</code> as List.</p>
  
  <pre><code>List&lt;num&gt; selectedUnit = [];
  List&lt;num&gt; selectedGrade = [];
  </code></pre>
  
  <p>i tried using <code>selectedUnit</code> and <code>selectedGrade</code> as map and it works.</p>
  
  <pre><code>var selectedUnit = {};
  var selectedGrade = {};
  </code></pre>
  
  <p>But i need to check if the list contains a certain value using <code>selectedUnit.contain()</code> and <code>selectedUnit.add()</code> and these are not available in Map.</p>
  
  <p>Please help.</p>