updateItem method

T updateItem(
  1. T oldItem,
  2. T call(
    1. T old
    ), [
  3. bool updateUi = false
])

Implementation

T updateItem(T oldItem, T Function(T old) call, [bool updateUi = false]) {
  final int index = array.indexOf(oldItem);
  final T newItem = call(get(index));
  array = array.replace(index, newItem);
  if (updateUi) {
    setState();
  }
  return newItem;
}