ensureVisible method

Future<void> ensureVisible(
  1. TextSpan span, {
  2. double alignment = 0.0,
  3. Duration duration = Duration.zero,
  4. Curve curve = Curves.ease,
  5. ScrollPositionAlignmentPolicy alignmentPolicy = ScrollPositionAlignmentPolicy.explicit,
  6. double offset = 0,
  7. int spanIndex = 0,
  8. int textBoxIndex = 0,
  9. bool spanSelector(
    1. List<TextBox> spanBoxes,
    2. int index,
    3. int length
    )?,
  10. bool textBoxSelector(
    1. TextBox textBox,
    2. int index,
    3. int length
    )?,
  11. double offsetSelector(
    1. TextBox textBox,
    2. double alignment
    )?,
})

Implementation

Future<void> ensureVisible(
  TextSpan span, {
  double alignment = 0.0,
  Duration duration = Duration.zero,
  Curve curve = Curves.ease,
  ScrollPositionAlignmentPolicy alignmentPolicy =
      ScrollPositionAlignmentPolicy.explicit,
  double offset = 0,
  int spanIndex = 0,
  int textBoxIndex = 0,
  bool Function(List<TextBox> spanBoxes, int index, int length)? spanSelector,
  bool Function(TextBox textBox, int index, int length)? textBoxSelector,
  double Function(TextBox textBox, double alignment)? offsetSelector,
}) {
  return _richTextPositionerKey.currentState!.ensureVisible(
    span,
    alignment: alignment,
    alignmentPolicy: alignmentPolicy,
    curve: curve,
    duration: duration,
    offset: offset,
    offsetSelector: offsetSelector,
    spanIndex: spanIndex,
    spanSelector: spanSelector,
    textBoxIndex: textBoxIndex,
    textBoxSelector: textBoxSelector,
  );
}