build method
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:
- the fields of the widget, which themselves must not change over time, and
- any ambient state obtained from the
context
using BuildContext.dependOnInheritedWidgetOfExactType.
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="M35.4 36.2C35.8418 35.8687 36.4686 35.9582 36.8 36.4L39.5 39.9998H41C41.5523 39.9998 42 40.4476 42 40.9998C42 41.5521 41.5523 41.9998 41 41.9998H36C35.4477 41.9998 35 41.5521 35 40.9998C35 40.4476 35.4477 39.9998 36 39.9998H36.9999L35.2 37.6C34.8686 37.1582 34.9582 36.5314 35.4 36.2Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M33 38C37.9706 38 42 33.9706 42 29C42 24.0295 37.9706 20 33 20C29.8795 20 27.1299 21.5882 25.5154 24.0003L32.5766 24.0001C35.5718 24.0001 38 26.4282 38 29.4234C38 31.8678 36.3647 34.0102 34.0068 34.6547L27.8049 36.3501C29.2724 37.3893 31.0649 38 33 38ZM26.0755 34.7495L33.4794 32.7255C34.9678 32.3187 36 30.9664 36 29.4234C36 27.5328 34.4673 26.0001 32.5766 26.0001L24.512 26.0003C24.1804 26.9386 24 27.9482 24 29C24 31.1861 24.7794 33.1902 26.0755 34.7495Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.569 37.6679C29.5659 37.3871 28.6336 36.9369 27.8049 36.3501L34.0068 34.6547C36.3647 34.0102 38 31.8678 38 29.4234C38 26.4282 35.5718 24.0001 32.5766 24.0001L25.5154 24.0003C26.0209 23.245 26.6377 22.5705 27.3424 22.0002C28.8882 20.7493 30.8566 20 33 20C37.9706 20 42 24.0295 42 29C42 33.9706 37.9706 38 33 38C32.1576 38 31.3423 37.8843 30.569 37.6679ZM39.997 29.2086C39.999 29.1393 40 29.0698 40 29C40 25.134 36.866 22 33 22C32.9297 22 32.8596 22.0011 32.7897 22.0031C36.7196 22.1139 39.8853 25.2789 39.997 29.2086ZM26.0755 34.7495L33.4794 32.7255C34.9678 32.3187 36 30.9664 36 29.4234C36 27.5328 34.4673 26.0001 32.5766 26.0001L24.512 26.0003C24.1804 26.9386 24 27.9482 24 29C24 31.1861 24.7794 33.1902 26.0755 34.7495ZM26.0706 28.0003C26.0241 28.3262 26 28.6599 26 29C26 30.2555 26.3291 31.4313 26.9067 32.4489L32.952 30.7963C33.5708 30.6272 34 30.0649 34 29.4234C34 28.6373 33.3628 28.0001 32.5767 28.0001L26.0706 28.0003Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.6 36.2C14.0418 36.5314 14.1314 37.1582 13.8 37.6L10.8 41.6C10.4686 42.0419 9.84183 42.1314 9.4 41.8C8.95817 41.4687 8.86863 40.8419 9.2 40.4L12.2 36.4C12.5314 35.9582 13.1582 35.8687 13.6 36.2Z" fill="black"/>
<path d="M7 41C7 40.4477 7.44772 40 8 40H13C13.5523 40 14 40.4477 14 41C14 41.5523 13.5523 42 13 42H8C7.44772 42 7 41.5523 7 41Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 40C7.44772 40 7 40.4477 7 41C7 41.5523 7.44772 42 8 42H13C13.5523 42 14 41.5523 14 41C14 40.4477 13.5523 40 13 40H8Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 32.0196C8 28.6951 10.6951 26 14.0196 26H32.5798C34.4687 26 36 27.5313 36 29.4202C36 30.9472 34.9877 32.2893 33.5194 32.7088L15.6733 37.8076C11.8279 38.9063 8 36.0189 8 32.0196ZM15.7324 33C15.3866 33.5978 14.7403 34 14 34C12.8954 34 12 33.1046 12 32C12 30.8955 12.8954 30 14 30C14.7403 30 15.3866 30.4022 15.7324 31H19C19.5523 31 20 31.4477 20 32C20 32.5523 19.5523 33 19 33H15.7324Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 32.0098C10 32.0131 10 32.0164 10 32.0196C10 34.6902 12.5561 36.6183 15.1239 35.8846L18.2199 35H16.6454C15.9414 35.6211 15.0155 36 14 36C11.7941 36 10.0053 34.2145 10 32.0098ZM14.0098 28C14.0131 28 14.0163 28 14.0196 28H32.5798C33.3642 28 34 28.6359 34 29.4202C34 30.0543 33.5797 30.6115 32.97 30.7857L21.0484 34.1919C21.634 33.6444 22 32.865 22 32C22 30.3432 20.6569 29 19 29H16.6454C15.9437 28.3809 15.0215 28.0025 14.0098 28ZM15.7324 33C15.3866 33.5978 14.7403 34 14 34C12.8954 34 12 33.1046 12 32C12 30.8955 12.8954 30 14 30C14.7403 30 15.3866 30.4022 15.7324 31H19C19.5523 31 20 31.4477 20 32C20 32.5523 19.5523 33 19 33H15.7324ZM14.0196 26C10.6951 26 8 28.6951 8 32.0196C8 36.0189 11.8279 38.9063 15.6733 37.8076L33.5194 32.7088C34.9877 32.2893 36 30.9472 36 29.4202C36 27.5313 34.4687 26 32.5798 26H14.0196Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7017 18.0455C11.2289 17.8808 11.7897 18.1746 11.9545 18.7017L14.4545 26.7016C14.6192 27.2288 14.3254 27.7897 13.7983 27.9544C13.2711 28.1191 12.7103 27.8253 12.5455 27.2982L10.0455 19.2983C9.88079 18.7712 10.1746 18.2103 10.7017 18.0455Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M35.3431 6.06073C35.8619 6.25023 36.1288 6.82438 35.9393 7.34314L34.9393 10.0807C34.8409 10.3501 34.6317 10.5642 34.3647 10.6688L30.7771 12.0738L33.9383 20.6542C34.1293 21.1724 33.8639 21.7473 33.3457 21.9383C32.8275 22.1292 32.2526 21.8639 32.0617 21.3456L28.5617 11.8457C28.3735 11.3349 28.6284 10.7674 29.1353 10.5689L33.2154 8.97094L34.0607 6.65692C34.2502 6.13816 34.8244 5.87124 35.3431 6.06073Z" fill="black"/>
<path d="M6 17.1497C6 15.4633 7.45602 14.1456 9.134 14.3134L13.6365 14.7637C14.9782 14.8979 16 16.0269 16 17.3753C16 18.8249 14.8249 20 13.3753 20H8.85037C7.27616 20 6 18.7239 6 17.1497Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.4375 16.7537L8.93499 16.3035C8.43439 16.2534 8 16.6466 8 17.1497C8 17.6193 8.38072 18 8.85037 18H13.3753C13.7203 18 14 17.7203 14 17.3753C14 17.0544 13.7568 16.7857 13.4375 16.7537ZM9.134 14.3134C7.45602 14.1456 6 15.4633 6 17.1497C6 18.7239 7.27616 20 8.85037 20H13.3753C14.8249 20 16 18.8249 16 17.3753C16 16.0269 14.9782 14.8979 13.6365 14.7637L9.134 14.3134Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);