updateRenderObject method

  1. @override
void updateRenderObject(
  1. BuildContext context,
  2. covariant RenderParagraph renderObject
)
override

Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.

This method should not do anything to update the children of the render object. That should instead be handled by the method that overrides RenderObjectElement.update in the object rendered by this object's createElement method. See, for example, SingleChildRenderObjectElement.update.

Implementation

@override
void updateRenderObject(BuildContext context, RenderParagraph renderObject) {
  assert(textDirection != null || debugCheckHasDirectionality(context));
  renderObject
    ..pixelSnap = PixelSnap.of(context)
    ..text = text
    ..textAlign = textAlign
    ..textDirection = textDirection ?? Directionality.of(context)
    ..softWrap = softWrap
    ..overflow = overflow
    ..textScaler = textScaler
    ..maxLines = maxLines
    ..strutStyle = strutStyle
    ..textWidthBasis = textWidthBasis
    ..textHeightBehavior = textHeightBehavior
    ..locale = locale ?? Localizations.maybeLocaleOf(context)
    ..registrar = selectionRegistrar
    ..selectionColor = selectionColor;
}