calculateCustomListDiff<T, L> function

DiffResult<T> calculateCustomListDiff<T, L>(
  1. L oldList,
  2. L newList, {
  3. bool detectMoves = true,
  4. bool equalityChecker(
    1. T,
    2. T
    )?,
  5. required T getByIndex(
    1. L,
    2. int
    ),
  6. required int getLength(
    1. L
    ),
})

you can use this function if you want to use custom list-types, such as BuiltList or KtList and want to avoid copying

Implementation

DiffResult<T> calculateCustomListDiff<T, L>(L oldList, L newList,
    {bool detectMoves = true,
    bool Function(T, T)? equalityChecker,
    required T Function(L, int) getByIndex,
    required int Function(L) getLength}) {
  return calculateDiff(
      CustomListDiffDelegate<T, L>(
        oldList: oldList,
        newList: newList,
        equalityChecker: equalityChecker,
        getLength: getLength,
        getByIndex: getByIndex,
      ),
      detectMoves: detectMoves);
}