INNER CODE UNIT · Dart
effectiveWidth
reqable/re-editor · lib/src/_code_field.dart:1047
effectiveWidth = constraints.maxWidth - _padding.horizontal;
} else {
effectiveWidth = double.infinity;
}
final double target = _verticalViewport.pixels;
if (_displayParagraphs.isEmpty) {
// Move the scroll offset to zero
final int startIndex;
if (target <= paddingTop) {
startIndex = 0;
} else {
startIndex = min(((target - paddingTop) / _preferredLineHeight).ceil(), _codes.length - 1);
}
_displayParagraphs.addAll(_buildDisplayRenderParagraphs(startIndex, effectiveWidth));
} else {
if (_codes.length <= _displayParagraphs.first.index) {
_displayParagraphs.clear();
_updateDisplayRenderParagraphs(cycle + 1);