ModelUpdates<T> class

Updates to a collection of items.

Provides a structured way to represent changes to collections including items that have been added, removed, or updated. The T type parameter represents the type of items in the collection.

Available extensions
Annotations
  • @freezed

Constructors

ModelUpdates({List<T> added = const [], Set<String> removedIds = const {}, List<T> updated = const []})
Creates a new ModelUpdates instance.
const

Properties

added List<T>
A list of items that have been added to the collection.
final
copyWith → $ModelUpdatesCopyWith<T, ModelUpdates<T>>
Create a copy of ModelUpdates with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
removedIds Set<String>
A set of IDs of items that have been removed from the collection.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updated List<T>
A list of items that have been updated in the collection.
final

Methods

applyTo(List<T> list, {required String key(T item), Comparator<T>? compare}) List<T>

Available on ModelUpdates<T>, provided by the ModelUpdatesExtension extension

Applies these updates to the given list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited