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="M14.8324 13.4189C17.0531 11.4934 19.8859 10.2552 22.9999 10.0354V12.0002C22.9999 12.5525 23.4476 13.0002 23.9999 13.0002C24.5522 13.0002 24.9999 12.5525 24.9999 12.0002V10.0354C28.1137 10.2552 30.9464 11.4932 33.167 13.4187L31.7781 14.8076C31.3875 15.1982 31.3875 15.8313 31.7781 16.2218C32.1686 16.6124 32.8017 16.6124 33.1923 16.2218L34.5812 14.8329C36.5068 17.0535 37.7449 19.8863 37.9647 23.0002H35.9999C35.4476 23.0002 34.9999 23.448 34.9999 24.0002C34.9999 24.5525 35.4476 25.0002 35.9999 25.0002H37.9647C37.7449 28.1141 36.5068 30.9469 34.5814 33.1674L33.1923 31.7783C32.8017 31.3878 32.1686 31.3878 31.7781 31.7783C31.3875 32.1689 31.3875 32.802 31.7781 33.1925L33.1672 34.5817C30.9466 36.5072 28.1138 37.7453 24.9999 37.9651V36.0002C24.9999 35.4479 24.5522 35.0002 23.9999 35.0002C23.4476 35.0002 22.9999 35.4479 22.9999 36.0002V37.9651C19.886 37.7453 17.0534 36.5073 14.8328 34.5819L16.2217 33.193C16.6122 32.8025 16.6122 32.1693 16.2217 31.7788C15.8312 31.3883 15.198 31.3883 14.8075 31.7788L13.4186 33.1677C11.493 30.9471 10.2548 28.1143 10.035 25.0002H11.9999C12.5522 25.0002 12.9999 24.5525 12.9999 24.0002C12.9999 23.448 12.5522 23.0002 11.9999 23.0002H10.035C10.2548 19.8864 11.4929 17.0537 13.4183 14.8331L14.8075 16.2224C15.198 16.6129 15.8312 16.6129 16.2217 16.2224C16.6122 15.8318 16.6122 15.1987 16.2217 14.8082L14.8324 13.4189ZM15.9999 21.0002C15.9999 20.448 15.5522 20.0002 14.9999 20.0002C14.4476 20.0002 13.9999 20.448 13.9999 21.0002V27.0002C13.9999 27.5525 14.4476 28.0002 14.9999 28.0002C15.5522 28.0002 15.9999 27.5525 15.9999 27.0002V25.0002H17.9999V27.0002C17.9999 27.5525 18.4476 28.0002 18.9999 28.0002C19.5522 28.0002 19.9999 27.5525 19.9999 27.0002V21.0002C19.9999 20.448 19.5522 20.0002 18.9999 20.0002C18.4476 20.0002 17.9999 20.448 17.9999 21.0002V23.0002H15.9999V21.0002ZM20.9999 21.0002C20.9999 20.448 21.4476 20.0002 21.9999 20.0002H24.4999C25.8806 20.0002 26.9999 21.1195 26.9999 22.5002C26.9999 23.881 25.8806 25.0002 24.4999 25.0002H22.9999V27.0002C22.9999 27.5525 22.5522 28.0002 21.9999 28.0002C21.4476 28.0002 20.9999 27.5525 20.9999 27.0002V21.0002ZM22.9999 23.0002H24.4999C24.776 23.0002 24.9999 22.7764 24.9999 22.5002C24.9999 22.2241 24.776 22.0002 24.4999 22.0002H22.9999V23.0002ZM31.923 27.3849C31.7677 27.7575 31.4036 28.0002 30.9999 28.0002C30.5962 28.0002 30.2321 27.7575 30.0768 27.3849L27.5768 21.3849C27.3644 20.8751 27.6055 20.2896 28.1153 20.0772C28.6251 19.8647 29.2105 20.1058 29.423 20.6156L30.9999 24.4002L32.5768 20.6156C32.7892 20.1058 33.3747 19.8647 33.8845 20.0772C34.3943 20.2896 34.6354 20.8751 34.423 21.3849L31.923 27.3849Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9999 5.00024C20.9999 4.44796 21.4476 4.00024 21.9999 4.00024H25.9999C26.5522 4.00024 26.9999 4.44796 26.9999 5.00024C26.9999 5.55253 26.5522 6.00024 25.9999 6.00024H24.9999V8.00024C24.9999 8.55253 24.5522 9.00024 23.9999 9.00024C23.4476 9.00024 22.9999 8.55253 22.9999 8.00024V6.00024H21.9999C21.4476 6.00024 20.9999 5.55253 20.9999 5.00024Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.9999 39.0002C24.5522 39.0002 24.9999 39.448 24.9999 40.0002V42.0002H25.9999C26.5522 42.0002 26.9999 42.448 26.9999 43.0002C26.9999 43.5525 26.5522 44.0002 25.9999 44.0002H21.9999C21.4476 44.0002 20.9999 43.5525 20.9999 43.0002C20.9999 42.448 21.4476 42.0002 21.9999 42.0002H22.9999V40.0002C22.9999 39.448 23.4476 39.0002 23.9999 39.0002Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6862 39.557C12.2956 39.9475 11.6625 39.9475 11.272 39.557L8.44353 36.7285C8.05301 36.338 8.05301 35.7048 8.44353 35.3143C8.83406 34.9238 9.46722 34.9238 9.85774 35.3143L10.5649 36.0214L11.9791 34.6072C12.3696 34.2167 13.0028 34.2167 13.3933 34.6072C13.7838 34.9977 13.7838 35.6309 13.3933 36.0214L11.9791 37.4356L12.6862 38.1427C13.0767 38.5333 13.0767 39.1664 12.6862 39.557Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.6065 13.394C34.216 13.0035 34.216 12.3703 34.6065 11.9798L36.0207 10.5656L35.3136 9.85848C34.9231 9.46795 34.9231 8.83479 35.3136 8.44426C35.7041 8.05374 36.3373 8.05374 36.7278 8.44426L39.5562 11.2727C39.9468 11.6632 39.9468 12.2964 39.5562 12.6869C39.1657 13.0774 38.5325 13.0774 38.142 12.6869L37.4349 11.9798L36.0207 13.394C35.6302 13.7845 34.997 13.7845 34.6065 13.394Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.99988 27.0002C4.44759 27.0002 3.99988 26.5525 3.99988 26.0002V22.0002C3.99988 21.448 4.44759 21.0002 4.99988 21.0002C5.55216 21.0002 5.99988 21.448 5.99988 22.0002V23.0002H7.99988C8.55216 23.0002 8.99988 23.448 8.99988 24.0002C8.99988 24.5525 8.55216 25.0002 7.99988 25.0002H5.99988V26.0002C5.99988 26.5525 5.55216 27.0002 4.99988 27.0002Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.9999 24.0002C38.9999 23.448 39.4476 23.0002 39.9999 23.0002H41.9999V22.0002C41.9999 21.448 42.4476 21.0002 42.9999 21.0002C43.5522 21.0002 43.9999 21.448 43.9999 22.0002V26.0002C43.9999 26.5525 43.5522 27.0002 42.9999 27.0002C42.4476 27.0002 41.9999 26.5525 41.9999 26.0002V25.0002H39.9999C39.4476 25.0002 38.9999 24.5525 38.9999 24.0002Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.44353 12.6868C8.053 12.2963 8.053 11.6632 8.44353 11.2726L11.272 8.4442C11.6625 8.05368 12.2956 8.05368 12.6862 8.4442C13.0767 8.83473 13.0767 9.46789 12.6862 9.85842L11.9791 10.5655L13.3933 11.9797C13.7838 12.3703 13.7838 13.0034 13.3933 13.3939C13.0028 13.7845 12.3696 13.7845 11.9791 13.3939L10.5648 11.9797L9.85774 12.6868C9.46722 13.0774 8.83405 13.0774 8.44353 12.6868Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.6065 34.6071C34.997 34.2166 35.6302 34.2166 36.0207 34.6071L37.4349 36.0214L38.142 35.3143C38.5325 34.9237 39.1657 34.9237 39.5562 35.3143C39.9468 35.7048 39.9468 36.3379 39.5562 36.7285L36.7278 39.5569C36.3373 39.9474 35.7041 39.9474 35.3136 39.5569C34.9231 39.1664 34.9231 38.5332 35.3136 38.1427L36.0207 37.4356L34.6065 36.0214C34.216 35.6308 34.216 34.9977 34.6065 34.6071Z" fill="black"/>
</svg>
''',
      colorFilter:
          color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
      width: width,
      height: height,
    );