modify method

FutureOr<T> modify(
  1. T modification(
    1. T input
    ), {
  2. required bool ignoreNotLoaded,
})

Implementation

FutureOr<T> modify(T modification(T input), {required bool ignoreNotLoaded}) {
  // ericm this was causing issues with assisted tasks - the pack tasks weren't loaded yet
  assert(!isNotLoaded || ignoreNotLoaded == true, "Should be loaded");
  if (isFuture) {
    return future.then((value) {
      update(modification(value));
      return value;
    });
  } else {
    update(modification(value));
    return value;
  }
}