addItem method

  1. @override
AlbumModel addItem(
  1. AlbumModel model,
  2. AlbumEntryModel newItem
)
override

Implementation

@override
AlbumModel addItem(AlbumModel model, AlbumEntryModel newItem) {
  List<AlbumEntryModel> newItems =
      model.albumEntries == null ? [] : model.albumEntries!;
  newItems.add(newItem);
  var newModel = model.copyWith(albumEntries: newItems);
  return newModel;
}