build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Describes the part of the user interface represented by this widget.

The framework calls this method when this widget is inserted into the tree in a given BuildContext and when the dependencies of this widget change (e.g., an InheritedWidget referenced by this widget changes). This method can potentially be called in every frame and should not have any side effects beyond building a widget.

The framework replaces the subtree below this widget with the widget returned by this method, either by updating the existing subtree or by removing the subtree and inflating a new subtree, depending on whether the widget returned by this method can update the root of the existing subtree, as determined by calling Widget.canUpdate.

Typically implementations return a newly created constellation of widgets that are configured with information from this widget's constructor and from the given BuildContext.

The given BuildContext contains information about the location in the tree at which this widget is being built. For example, the context provides the set of inherited widgets for this location in the tree. A given widget might be built with multiple different BuildContext arguments over time if the widget is moved around the tree or if the widget is inserted into the tree in multiple places at once.

The implementation of this method must only depend on:

If a widget's build method is to depend on anything else, use a StatefulWidget instead.

See also:

  • StatelessWidget, which contains the discussion on performance considerations.

Implementation

@override
widgets.Widget build(widgets.BuildContext context) => SvgPicture.string(
      '''
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.5236 8.01845C9.7428 8.02776 8.50291 8.03704 6.49988 8.03704V6.03704C8.49685 6.03704 9.72858 6.02779 10.4997 6.01859C10.9092 6.0137 11.1997 6.0086 11.4058 6.00498C11.5768 6.00198 11.6897 6 11.7645 6C18.5964 6 24.2341 11.2429 24.2341 17.8294V18.9258L26.5175 22.1597C27.8289 24.017 26.3432 26.3254 24.2341 26.3267V26.9927C24.2341 28.0584 23.3365 28.8258 22.3518 28.8258H21.671L22.7074 29.5254C23.5424 29.6838 24.2341 30.3894 24.2341 31.3249V32.824C24.2341 34.421 23.334 35.7905 22.042 36.5355C21.1651 37.0411 20.249 37.0908 19.5129 36.9992C18.7963 36.9101 18.1387 36.6743 17.6507 36.4769L15.4113 35.5707V40.167C15.4113 41.2327 14.5137 42 13.529 42H11.4999V40H13.4113V34.0873C13.4113 33.7548 13.5766 33.444 13.8523 33.2581C14.1281 33.0722 14.4782 33.0356 14.7864 33.1603L18.4009 34.6229C18.8371 34.7994 19.3032 34.9578 19.7597 35.0145C20.2186 35.0716 20.6585 35.0246 21.0429 34.8029C21.7761 34.3802 22.2341 33.6389 22.2341 32.824V31.4849C22.0764 31.4662 21.9249 31.4101 21.7923 31.3207L19.0768 29.4876C18.8014 29.3017 18.6363 28.9911 18.6363 28.6588C18.6363 28.2734 18.7281 27.8662 19.0009 27.5207C19.2706 27.1792 19.6248 27.0155 19.9204 26.9335C20.2069 26.8542 20.5022 26.8338 20.7434 26.8269C20.9089 26.8222 21.0968 26.8236 21.2668 26.8248C21.3386 26.8253 21.4072 26.8258 21.4695 26.8258H22.2341V25.3267C22.2341 24.7744 22.6818 24.3267 23.2341 24.3267H24.2324C24.5681 24.3267 24.8027 24.1573 24.9182 23.9536C25.0306 23.7553 25.0345 23.5268 24.8837 23.3132L22.4172 19.82C22.2981 19.6513 22.2341 19.4498 22.2341 19.2432V17.8294C22.2341 12.4541 17.6016 8 11.7645 8C11.6972 8 11.6068 8.00164 11.4618 8.00427C11.2695 8.00776 10.9813 8.01299 10.5236 8.01845Z" fill="black"/>
<path d="M20.9999 19.5C20.9999 20.3284 20.3283 21 19.4999 21C18.6715 21 17.9999 20.3284 17.9999 19.5C17.9999 18.6716 18.6715 18 19.4999 18C20.3283 18 20.9999 18.6716 20.9999 19.5Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M28.4954 32.0835C29.205 31.6688 29.6841 30.8925 29.6841 29.9995C29.6841 29.1066 29.205 28.3303 28.4954 27.9156L29.5044 26.1888C30.8084 26.9508 31.6841 28.3736 31.6841 29.9995C31.6841 31.6254 30.8084 33.0483 29.5044 33.8103L28.4954 32.0835Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M31.7822 34.6633C32.9951 33.7858 33.8946 32.0671 33.8946 29.9999C33.8946 27.9327 32.9951 26.214 31.7822 25.3365L32.9545 23.7161C34.762 25.0238 35.8946 27.3893 35.8946 29.9999C35.8946 32.6106 34.762 34.9761 32.9545 36.2837L31.7822 34.6633Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.105 29.9999C38.105 26.8185 36.8409 24.152 35.1153 22.7835L36.358 21.2165C38.6596 23.0417 40.105 26.3444 40.105 29.9999C40.105 33.6554 38.6596 36.9581 36.358 38.7834L35.1153 37.2163C36.8409 35.8478 38.105 33.1813 38.105 29.9999Z" fill="black"/>
</svg>
''',
      colorFilter:
          color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
      width: width,
      height: height,
    );