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 d="M12.8403 15.8022C13.3926 15.8022 13.8403 15.3545 13.8403 14.8022C13.8403 14.25 13.3926 13.8022 12.8403 13.8022C12.288 13.8022 11.8403 14.25 11.8403 14.8022C11.8403 15.3545 12.288 15.8022 12.8403 15.8022Z" fill="black"/>
<path d="M11.0024 24.2021C11.0024 24.7544 10.5547 25.2021 10.0024 25.2021C9.45016 25.2021 9.00244 24.7544 9.00244 24.2021C9.00244 23.6499 9.45016 23.2021 10.0024 23.2021C10.5547 23.2021 11.0024 23.6499 11.0024 24.2021Z" fill="black"/>
<path d="M12 34.3667C12.5523 34.3667 13 33.919 13 33.3667C13 32.8144 12.5523 32.3667 12 32.3667C11.4477 32.3667 11 32.8144 11 33.3667C11 33.919 11.4477 34.3667 12 34.3667Z" fill="black"/>
<path d="M25.6582 34C26.2105 34 26.6582 33.5523 26.6582 33C26.6582 32.4477 26.2105 32 25.6582 32C25.1059 32 24.6582 32.4477 24.6582 33C24.6582 33.5523 25.1059 34 25.6582 34Z" fill="black"/>
<path d="M36.8403 33.8022C37.3926 33.8022 37.8403 33.3545 37.8403 32.8022C37.8403 32.25 37.3926 31.8022 36.8403 31.8022C36.288 31.8022 35.8403 32.25 35.8403 32.8022C35.8403 33.3545 36.288 33.8022 36.8403 33.8022Z" fill="black"/>
<path d="M35.8403 24.8022C35.8403 25.3545 35.3926 25.8022 34.8403 25.8022C34.288 25.8022 33.8403 25.3545 33.8403 24.8022C33.8403 24.25 34.288 23.8022 34.8403 23.8022C35.3926 23.8022 35.8403 24.25 35.8403 24.8022Z" fill="black"/>
<path d="M23.8403 25.8022C24.3926 25.8022 24.8403 25.3545 24.8403 24.8022C24.8403 24.25 24.3926 23.8022 23.8403 23.8022C23.288 23.8022 22.8403 24.25 22.8403 24.8022C22.8403 25.3545 23.288 25.8022 23.8403 25.8022Z" fill="black"/>
<path d="M27.8403 15.8022C27.8403 16.3545 27.3926 16.8022 26.8403 16.8022C26.288 16.8022 25.8403 16.3545 25.8403 15.8022C25.8403 15.25 26.288 14.8022 26.8403 14.8022C27.3926 14.8022 27.8403 15.25 27.8403 15.8022Z" fill="black"/>
<path d="M38.8403 14.8022C38.8403 15.3545 38.3926 15.8022 37.8403 15.8022C37.288 15.8022 36.8403 15.3545 36.8403 14.8022C36.8403 14.25 37.288 13.8022 37.8403 13.8022C38.3926 13.8022 38.8403 14.25 38.8403 14.8022Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.11426 28.3019V34C4.11426 36.2091 5.90512 38 8.11426 38H40.0002C42.2094 38 44.0002 36.2091 44.0002 34V14C44.0002 11.7909 42.2094 10 40.0002 10H8.11426C5.90512 10 4.11426 11.7909 4.11426 14V27.3729C4.05383 27.488 4.01498 27.6168 4.00351 27.7545C3.98712 27.9512 4.0288 28.1392 4.11426 28.3019ZM8.11426 12H17.9879L13.9929 19.1909L6.22926 17.3642C6.19088 17.3552 6.1525 17.3485 6.11426 17.3441V14C6.11426 12.8954 7.00969 12 8.11426 12ZM6.11426 19.3918L13.7155 21.1803L15.7626 27.731L6.11426 26.9269V19.3918ZM6.11426 28.9339L15.5208 29.7177L13.5576 36H8.11426C7.00969 36 6.11426 35.1046 6.11426 34V28.9339ZM17.5921 29.795L15.653 36H33.6685L29.7037 28.8633L17.5921 29.795ZM32.0711 29.0064L35.874 35.8516C35.9009 35.8999 35.9233 35.9496 35.9414 36H40.0002C41.1048 36 42.0002 35.1046 42.0002 34V29.8008L32.0711 29.0064ZM42.0002 27.7944L31.1753 26.9284L33.257 20.2669L42.0002 19.3926V27.7944ZM29.0873 26.9048L17.8694 27.7677L15.8373 21.2649L31.115 20.4161L29.0873 26.9048ZM16.2543 19.2386L31.1625 18.4104L29.1593 12H20.2758L16.2543 19.2386ZM33.2114 18.2615L42.0002 17.3826V14C42.0002 12.8954 41.1048 12 40.0002 12H31.2546L33.2114 18.2615Z" fill="black"/>
</svg>
''',
      colorFilter:
          color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
      width: width,
      height: height,
    );