when<T> method
T
when<T>({
- required T insert(),
- required T remove(),
- required T change(),
- required T move(),
override
call one of the given callback functions depending on the type of this object.
@param insert callback function to be called if this object is of type Insert @param remove callback function to be called if this object is of type Remove @param change callback function to be called if this object is of type Change @param move callback function to be called if this object is of type Move
Implementation
@override
T when<T>(
{required T Function(int p1, int p2) insert,
required T Function(int p1, int p2) remove,
required T Function(int p1, Object? p2) change,
required T Function(int p1, int p2) move}) {
return change(position, payload);
}