title: Flutter does not fetch all Data
body: <p>i try to be short.
  First i had a App where you can save a place with one image, and i can fetch it.
  But now i tought well it would be better if you have the choice to upload two or three images.</p>
  <p>I updated my code, but know when i create a new entry with one or two images, they disappear when i reload the app, only the one with 3 images are showing.</p>
  <p>i tried it with 3 fetches, and a future wait, but that not work</p>
  <p>now some code, i hope someone can help me, and i hope thats enough code</p>
  <p>Thanks much.</p>
  <p>Code with the adding screen:</p>
  <pre><code>class AddPlacesScreen extends StatefulWidget {
    static const routName = '/add-place';
  
    @override
    _AddPlacesScreenState createState() =&gt; _AddPlacesScreenState();
  }
  
  class _AddPlacesScreenState extends State&lt;AddPlacesScreen&gt; {
    DateTime _selectedDate;
  
    //Controller um das Titel zu &quot;Kontrollieren&quot;
    final _titleController = TextEditingController();
    final _pickedLocation = TextEditingController();
    final _pickedDescription = TextEditingController();
    final _pickedDuration = TextEditingController();
  
    // Variabeln für spätere Änderungen, mehr Bilder und Maps
    final _pickedLatitude = &quot;1&quot;;
    final _pickedLongitude = &quot;1&quot;;
    final _pickedAddress = &quot;noAddressAvailable&quot;;
  
  //_selectImage muss dann unten ImageInput übergeben werden und im WIdget definieren
    File _pickedImage;
    File _pickedImage2;
    File _pickedImage3;
  
    //PlaceLocation _pickedLocation;
  
    void _selectImage(File pickedImage) {
      //_pickedImage = pickedImage;
      setState(() {
        _pickedImage = pickedImage;
      });
    }
  
    void _selectImage2(File pickedImage2) {
      //_pickedImage2 = pickedImage;
      setState(() {
        _pickedImage2 = pickedImage2;
      });
    }
  
    void _selectImage3(File pickedImage3) {
      _pickedImage3 = pickedImage3;
    }
    // void _selectPlace(double lat, double lng) {
    //  _pickedLocation = PlaceLocation(latitude: lat, longitude: lng);
    // }
  
  //------------ TODOO FEHLERMELDUNG EINBAUEN UND DATUM ALS PFLICHTFELD ------------------------------
  //_pickedImage == null || _pickedLocation == null
  
  // set up the AlertDialog
    void _showErrorDialog(String message) {
      showDialog(
          context: context,
          builder: (ctx) =&gt; AlertDialog(
                title: Text('Hoppala...'),
                content: Text(message),
                actions: [
                  FlatButton(
                      onPressed: () {
                        Navigator.of(ctx).pop();
                      },
                      child: Text('OK'))
                ],
              ));
    }
  
    void _savePlace() {
      if (_titleController.text.isEmpty) {
        var errorMessage = 'Bitte gib einen Titel ein';
        return _showErrorDialog(errorMessage);
      }
      if (_pickedLocation.text.isEmpty) {
        var errorMessage = 'Bitte gib einen Ort ein';
        return _showErrorDialog(errorMessage);
      }
      if (_selectedDate == null) {
        var errorMessage = 'Bitte gib ein Datum ein';
        return _showErrorDialog(errorMessage);
      }
      if (_pickedImage == null) {
        var errorMessage = 'Bitte wähle mindestens ein Bild aus';
        return _showErrorDialog(errorMessage);
      }
  
      //add place ausführen über provider
      Provider.of&lt;GreatPlaces&gt;(context, listen: false).addPlace(
        _titleController.text,
        _pickedImage,
        _pickedImage2,
        _pickedImage3,
        DateFormat(&quot;dd.MM.yyyy&quot;).format(_selectedDate),
        _pickedLocation.text,
        _pickedDescription.text,
        _pickedDuration.text,
        _pickedLatitude,
        _pickedLongitude,
        _pickedAddress,
      );
      Navigator.of(context).pop();
      print(_pickedImage);
      print(_pickedImage2);
      print(_pickedImage3);
    }
  
    void _presentdatePicker() {
      showDatePicker(
        context: context,
        initialDate: DateTime.now(),
        firstDate: DateTime(2020),
        lastDate: DateTime(2030),
      ).then((pickedDate) {
        if (pickedDate == null) {
          return;
        }
        // muss gesetzt werden sonst wird die Form / Widget nicht aktualisiert
        setState(() {
          _selectedDate = pickedDate;
        });
      });
    }
  
    @override
    Widget build(BuildContext context) {
      //Date Time beim öffnen soll die aktuelle Zeit bei mspeichern angezeigt werden
      //  final timeCreate = new DateTime.now();
      //  String formattedDate = DateFormat('dd-MM-yyyy').format(timeCreate);
      // print(formattedDate);
  
      //bei ganzer Seite ein Scaffold
      return Scaffold(
        appBar: AppBar(
          title: Text('Füge deine Wanderung hinzu'),
          flexibleSpace: Container(
            decoration: BoxDecoration(
                gradient: LinearGradient(
                    begin: Alignment.topLeft,
                    end: Alignment.bottomRight,
                    colors: &lt;Color&gt;[
                  Colors.green[200],
                  Colors.brown[300],
                ])),
          ),
        ),
        //Body mit Column da -&gt; Spalte da wir sachen übereinander sind also von oben nach unten
        body: Column(
          //Text und Button werden getrennt oben und unten
          //mainAxisAlignment: MainAxisAlignment.spaceBetween &lt;---- mit Expanded wird das nicht mehr benötigt
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            //Textfelder untereinander mit einem Expanded einfügen
            //Column warp mit widget dann Padding dann Padding wrappen mit SingleCHildScrollView in die Column kommen dann die Textfelder
            Expanded(
                child: SingleChildScrollView(
              child: Padding(
                padding: EdgeInsets.all(10),
                child: Column(
                  children: [
                    TextField(
                      decoration: InputDecoration(labelText: 'Titel'),
                      controller: _titleController,
                      // hier erweitern mit valdiation etc...
                    ),
                    TextField(
                      decoration: InputDecoration(labelText: 'Ort'),
                      controller: _pickedLocation,
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    //Sizedbox mit 10 Pixel für eine nkleinen Abstand
                    SizedBox(
                      height: 10,
                    ),
                    //Widget erstellt für Container und Flatbutton in image_input.dart
  
                    _pickedImage == null
                        ? ImageInput(_selectImage)
                        : _pickedImage2 == null
                            ? ImageInput2(_selectImage2)
                            : ImageInput3(_selectImage3),
                    SizedBox(
                      height: 10,
                    ),
  
                    // ------- MAPS BOX AKTUELLER STANDOIRT UND STANDORT AUSWÄHLEN = LocationInput() aktuell nicht benötigt deshalb auskommentiert -----------
                    //location_input.dart
                    //LocationInput()
                    // ------ NEU Memo Feld --------
                    TextField(
                      decoration: InputDecoration(
                          labelText: 'Beschreibung',
                          hintText: &quot;Kurze Beschreibung der Wanderung&quot;),
                      controller: _pickedDescription,
                    ),
                    TextField(
                      decoration: InputDecoration(
                          labelText: 'Dauer',
                          hintText: &quot;z.B. 3.5&quot;,
                          counterText: &quot;&quot;,
                          contentPadding: EdgeInsets.all(1)),
                      controller: _pickedDuration,
                      maxLength: 5,
                    ),
                    //----------------- Datetime Picker --------------------
                    Container(
                      height: 50,
                      child: Row(
                        children: [
                          Expanded(
                            child: Text(
                              _selectedDate == null
                                  ? 'Kein Datum ausgewählt!'
                                  : ' Gewähltes Datum: ${DateFormat(&quot;dd.MM.yyyy&quot;).format(_selectedDate)}',
                            ),
                          ),
                          // WIdget ist in adaptive flat button, und übergabe erfolgt dann in ()
                          AdaptiveFlatButton(
                              'Datum auswählen', _presentdatePicker)
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            )),
            RaisedButton.icon(
              icon: Icon(Icons.add),
              label: Text('Berg Hinzufügen'),
              onPressed: _savePlace,
              elevation: 0,
              //Der button ist ganz unten an der Kante
              materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
              color: Theme.of(context).accentColor,
            )
          ],
        ),
      );
    }
  }
  </code></pre>
  <p>Code with where all places should be:</p>
  <pre><code>class PlacesListScreen extends StatefulWidget {
    static const routName = '/place-list';
    @override
    _PlacesListScreenState createState() =&gt; _PlacesListScreenState();
  }
  
  class _PlacesListScreenState extends State&lt;PlacesListScreen&gt; {
    var _isDeleted = false;
  
    //@override
    //void setState(fn) {
    //if (_isDeleted == true) {
    //print(&quot;ok ist jetzt drin&quot;);
    //_isDeleted = false;
    //}
    // super.setState(fn);
    //}
  
    @override
    Widget build(BuildContext context) {
      //final scaffold = Scaffold.of(context);
      return Scaffold(
          appBar: //Platform.isIOS
              //? CupertinoNavigationBar(
              //  middle: Text('Berg-Tagebuch'),
              //  icon: Icon(Icons.add),
              //  onPressed: () {
              //  Navigator.of(context).pushNamed(AddPlacesScreen.routName);
              // }),
              //)
              // : AppBar(
              AppBar(
            title: Text('Berg-Tagebuch'),
            flexibleSpace: Container(
              decoration: BoxDecoration(
                  gradient: LinearGradient(
                      begin: Alignment.topLeft,
                      end: Alignment.bottomRight,
                      colors: &lt;Color&gt;[
                    Colors.green[200],
                    Colors.brown[300],
                  ])),
            ),
            actions: [
              IconButton(
                icon: Icon(Icons.add),
                onPressed: () {
                  //zum neuen Screen navigieren
                  Navigator.of(context).pushNamed(AddPlacesScreen.routName);
                },
              ),
            ],
          ),
  
          //wenn sich was ändert im GreatPlaces dann soll die Liste sich hier aktualiseren
          body: FutureBuilder(
            //aus great_places.dart hole ich mir die fetch Methode die ich erstellt habe
            //Zusätzlich 2 weitere erstellt um 2 images und mit 3 images zu laden
            future: Future.wait([
              Provider.of&lt;GreatPlaces&gt;(context, listen: false)
                  .fetchAndSetPlaces(),
              Provider.of&lt;GreatPlaces&gt;(context, listen: false)
                  .fetchAndSetPlaces2(),
              Provider.of&lt;GreatPlaces&gt;(context, listen: false)
                  .fetchAndSetPlaces3()
            ]),
  
            builder: (ctx, snapshot) =&gt; snapshot.connectionState ==
                    ConnectionState.waiting
                ? Center(child: CircularProgressIndicator())
                : Consumer&lt;GreatPlaces&gt;(
                    child: Center(
                      child: const Text(
                          'Noch keine Wanderungen hinzugefügt, fang jetzt an !'),
                    ),
                    builder: (ctx, greatPlaces, ch) =&gt; greatPlaces.items.length &lt;=
                            0
                        ? ch
                        : //ListView.separator -----&gt; mit Linien was ist besser ?
                        ListView.builder(
                            itemCount: greatPlaces.items.length,
                            itemBuilder: (ctx, index) =&gt; Card(
                              shape: RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(15.0),
                              ),
                              child: ListTile(
                                leading: CircleAvatar(
                                  backgroundImage:
                                      FileImage(greatPlaces.items[index].image),
                                ),
                                title: Text(greatPlaces.items[index].title),
                                subtitle:
                                    Text(greatPlaces.items[index].createTime),
                                //   On Tap öffnet dann die Details Seite
                                onTap: () =&gt; Navigator.of(context).pushNamed(
                                    PlaceDetailScreen.routName,
                                    arguments: greatPlaces.items[index].id),
                                trailing: Container(
                                  width: 100,
                                  child: Row(
                                    children: [
                                      //Button um in den bearbeitungsmodus zu wechseln
                                      IconButton(
                                          icon: Icon(Icons.edit),
                                          onPressed: () =&gt;
                                              Navigator.of(context).pushNamed(
                                                EditPlacesScreen.routName,
                                                arguments:
                                                    greatPlaces.items[index].id,
                                              ),
                                          color: Colors.cyan),
                                      IconButton(
                                        icon: Icon(Icons.delete),
                                        onPressed: () async {
                                          try {
                                            print(_isDeleted);
                                            return showDialog(
                                                context: context,
                                                barrierDismissible: true,
                                                builder: (param) {
                                                  return AlertDialog(
                                                    actions: [
                                                      FlatButton(
                                                        onPressed: () =&gt;
                                                            Navigator.pop(
                                                                context),
                                                        child: Text(&quot;Abbruch&quot;),
                                                        color: Colors.green[100],
                                                      ),
                                                      FlatButton(
                                                        onPressed: () {
                                                          DBHelper.delete(
                                                              greatPlaces
                                                                  .items[index]
                                                                  .id);
                                                          //set state damit löschen aktualisiert wird
                                                          setState(() {});
  
                                                          Scaffold.of(ctx)
                                                              .showSnackBar(SnackBar(
                                                                  content: Text(
                                                                      &quot;Die Wanderung wurde entfernt&quot;)));
                                                          Navigator.pop(context);
                                                        },
                                                        child: Text(&quot;Löschen&quot;),
                                                        color: Colors.red[200],
                                                      ),
                                                    ],
                                                    title: Text(
                                                        &quot;Wanderung wirklich löschen ?&quot;),
                                                  );
                                                });
                                          } catch (error) {
                                            //Hinweis geben das löschen fehlgeschlagen ist über snackbar
                                            //  scaffold.showSnackBar(SnackBar(
                                            //   content: Text(
                                            // 'Löschen Fehlgeschlagen !!',
                                            // textAlign: TextAlign.center,
                                            // )));
                                          }
                                        },
                                        color: Theme.of(context).errorColor,
                                      ),
                                    ],
                                  ),
                                ),
                              ),
                            ),
                            // separatorBuilder: (context, index) =&gt; Divider(
                            //   color: Colors.black,
                            // ),
                          ),
                  ),
          ));
    }
  }
  </code></pre>
  <p>And the one where with the methods:</p>
  <pre><code>class GreatPlaces with ChangeNotifier {
    //To set Creation Time
    static DateTime actualTime = DateTime.now();
    String formattedDate = DateFormat('dd-MM-yyyy').format(actualTime);
  
    List&lt;Place&gt; _items = [];
  
    List&lt;Place&gt; get items {
      return [..._items];
    }
  
    //Information des gesamten places
    Place findById(String id) {
      return items.firstWhere((place) =&gt; place.id == id);
    }
  
    Future&lt;void&gt; addPlace(
      String pickedTitle,
      File pickedImage,
      File pickedImage2,
      File pickedImage3,
      String pickedDate,
      String pickedLocation,
      String pickedDescription,
      String pickedDuration,
      String pickedLatitude,
      String pickedLontitude,
      String pickedAdress,
      //PlaceLocation pickedLocation,
    ) async {
      //final address = await LocationHelper.getPlaceAddress(
      //  pickedLocation.latitude, pickedLocation.longitude);
      //   final updatedLocation = PlaceLocation(
      //    latitude: pickedLocation.latitude,
      //   longitude: pickedLocation.longitude,
      //    address: address);
      final newPlace = Place(
        id: DateTime.now().toString(),
        image: pickedImage,
        image2: pickedImage2,
        image3: pickedImage3,
        title: pickedTitle,
        createTime: pickedDate,
        place: pickedLocation,
        description: pickedDescription,
        duration: pickedDuration,
      );
      //location: null);
      _items.add(newPlace);
      notifyListeners();
      //übergabe 'wanderwege' so wie in db_helper definiert , Data ist von typ map
      DBHelper.insert('user_places', {
        'id': newPlace.id,
        'title': newPlace.title,
        'image': newPlace.image.path,
        'image2': newPlace.image2.path,
        'image3': newPlace.image3.path,
        'createTime': newPlace.createTime,
        'place': newPlace.place,
        'description': newPlace.description,
        'duration': newPlace.duration,
        'loc_lat': newPlace.latitude,
        'loc_lng': newPlace.longitude,
        'address': newPlace.address,
      });
    }
  
    //Die ganzen places aus der DB holen
    Future&lt;void&gt; fetchAndSetPlaces() async {
      final dataList = await DBHelper.getData('user_places');
      _items = dataList
          .map((item) =&gt; Place(
                id: item['id'],
                title: item['title'],
                image: File(item['image']),
                createTime: item['createTime'],
                place: item['place'],
                description: item['description'],
                duration: item['duration'],
                latitude: null,
                longitude: null,
                address: null,
              ))
          .toList();
      notifyListeners();
    }
  
    Future&lt;void&gt; fetchAndSetPlaces2() async {
      final dataList = await DBHelper.getData('user_places');
      _items = dataList
          .map((item) =&gt; Place(
                id: item['id'],
                title: item['title'],
                image: File(item['image']),
                image2: File(item['image2']),
                createTime: item['createTime'],
                place: item['place'],
                description: item['description'],
                duration: item['duration'],
                latitude: null,
                longitude: null,
                address: null,
              ))
          .toList();
      notifyListeners();
    }
  
    Future&lt;void&gt; fetchAndSetPlaces3() async {
      final dataList = await DBHelper.getData('user_places');
      _items = dataList
          .map((item) =&gt; Place(
                id: item['id'],
                title: item['title'],
                image: File(item['image']),
                image2: File(item['image2']),
                image3: File(item['image3']),
                createTime: item['createTime'],
                place: item['place'],
                description: item['description'],
                duration: item['duration'],
                latitude: null,
                longitude: null,
                address: null,
              ))
          .toList();
      notifyListeners();
    }
  }
  </code></pre>