updateItem method
Implementation
void updateItem(bool Function(T item) test, T updatedItem) {
if (state is! ListLoaded<T>) return;
final current = state as ListLoaded<T>;
final updatedItems = current.items
.map((item) => test(item) ? updatedItem : item)
.toList();
emit(current.copyWith(items: updatedItems));
}