addItem method

  1. @override
FaderModel addItem(
  1. FaderModel model,
  2. ListedItemModel newItem
)
override

Implementation

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