addItem method

  1. @override
DocumentModel addItem(
  1. DocumentModel model,
  2. DocumentItemModel newItem
)
override

Implementation

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