tabIndex property Null safety

int tabIndex

Gets or sets the tab index for form fields.

The default value is 0.

Implementation

int get tabIndex {
  if (_isLoadedField) {
    if (page != null) {
      final _PdfDictionary annotDic =
          _getWidgetAnnotation(_dictionary, _crossTable);
      final _PdfReference reference =
          page!._crossTable!._getReference(annotDic);
      _tabIndex = page!._annotsReference._indexOf(reference);
    }
  }
  return _tabIndex;
}
void tabIndex=(int value)

Implementation

set tabIndex(int value) {
  _tabIndex = value;
  if (_isLoadedField &&
      page != null &&
      page!.formFieldsTabOrder == PdfFormFieldsTabOrder.manual) {
    final PdfAnnotation annotationReference =
        _WidgetAnnotation._(_dictionary, _crossTable!);
    final _PdfReference reference =
        page!._crossTable!._getReference(annotationReference._element);
    int index = page!._annotsReference._indexOf(reference);
    if (index < 0) {
      index = _annotationIndex;
    }
    final _PdfArray? annots =
        page!.annotations._rearrange(reference, _tabIndex, index);
    page!._dictionary.setProperty(_DictionaryProperties.annots, annots);
  }
}