INNER CODE UNIT · Dart

target

reqable/re-editor · lib/src/_code_field.dart:685

          final double target = max(0, first.top - _preferredLineHeight * (first.index - position.index) - size.height / 2);
          scrollViewport(_verticalViewport, target);
        }
        final CodeLineRenderParagraph last = _displayParagraphs.last;
        if (position.index > last.index) {
          final double target = min(
            _verticalViewportSize!,
            last.bottom + size.height / 2 + _preferredLineHeight * (position.index - first.index),
          );
          scrollViewport(_verticalViewport, target);
        }
      }
      if (tryCount < 10) {
        SchedulerBinding.instance.addPostFrameCallback((timeStamp) {
          // Check whether the viewport is still valid.
          final ViewportOffset viewport = _verticalViewport;
          if (viewport is ScrollPosition && viewport.context.notificationContext == null) {
            return;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…