createRenderObject method

  1. @override
RenderSortIcon createRenderObject(
  1. BuildContext context
)
override

Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.

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

Implementation

@override
RenderSortIcon createRenderObject(BuildContext context) {
  if (size == SortIconSize.size12) {
    return _RenderSize12(
        direction: direction, debug: debug, color: color, inverted: inverted);
  } else if (size == SortIconSize.size14) {
    return _RenderSize14(
        direction: direction, debug: debug, color: color, inverted: inverted);
  } else if (size == SortIconSize.size16Short) {
    return _RenderSize16Short(
        direction: direction, debug: debug, color: color, inverted: inverted);
  } else if (size == SortIconSize.size16Tall) {
    return _RenderSize16Tall(
        direction: direction, debug: debug, color: color, inverted: inverted);
  } else if (size == SortIconSize.size19) {
    return _RenderSize19(
        direction: direction, debug: debug, color: color, inverted: inverted);
  }
  throw StateError('Unrecognized size: $size');
}