isIndexReadonly method

bool isIndexReadonly([
  1. FormIndex? index
])

Whether the element at index (by default the current one) is read-only; the beginning and end of the form are.

Implementation

bool isIndexReadonly([FormIndex? index]) {
  index ??= _currentFormIndex;
  if (!index.isInForm) return true;
  final ref = form.childInstanceRef(index)!;
  final e = event(index);
  if (e == FormEntryEvent.promptNewRepeat ||
      e == FormEntryEvent.repeatJuncture) {
    return false;
  }
  return !form.mainInstance.resolveReference(ref)!.isEnabled;
}