findItem method

T? findItem(
  1. bool test(
    1. T e
    )
)

Implementation

T? findItem(bool Function(T e) test) {
  final list = state.data?.items;

  try {
    final old = list?.firstWhere(test);
    return old;
  } catch (_) {
    return null;
  }
}