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="M15 18C17.2092 18 19 16.2091 19 14C19 11.7909 17.2092 10 15 10C12.7909 10 11 11.7909 11 14C11 16.2091 12.7909 18 15 18ZM15 16C16.1046 16 17 15.1046 17 14C17 12.8954 16.1046 12 15 12C13.8954 12 13 12.8954 13 14C13 15.1046 13.8954 16 15 16Z" fill="black"/>
<path d="M18.2677 23.4022L12.5689 20.9998L18.2677 23.4038V23.4022Z" fill="black"/>
<path d="M18.2677 23.4022L18.4397 23.4747L18.2677 23.2147V23.4022Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.82026 19.9893C10.3831 19.5633 11.3317 18.9998 12.5689 18.9998H17.5654C18.9281 18.9998 19.9455 19.7185 20.4401 20.1179C21.0208 20.587 21.5221 21.1512 21.9105 21.6328C22.5286 22.3992 23.1009 23.268 23.4256 23.7607L23.4325 23.7712C23.5115 23.8912 23.572 23.9829 23.6168 24.0489C23.8241 24.3544 23.9675 24.6845 24.0499 25.0233C24.1229 24.6351 24.2764 24.2556 24.515 23.9094C24.614 23.7657 24.7327 23.5871 24.8715 23.3783L24.8832 23.3607C25.2627 22.7895 25.7756 22.0178 26.2823 21.3873C26.6434 20.938 27.1154 20.4096 27.6859 19.973C28.2292 19.5572 29.1535 19 30.364 19H35.193C36.5263 19 37.5172 19.7102 37.9931 20.0989C38.5547 20.5576 39.0392 21.109 39.4141 21.5791C40.0109 22.3275 40.5637 23.1759 40.8775 23.6575L40.8814 23.6636L40.8842 23.6678L40.8901 23.6768C40.9636 23.7896 41.0201 23.8764 41.0624 23.9394C41.9593 25.2759 41.6029 27.0865 40.2663 27.9835C39.7239 28.3474 39.1035 28.505 38.4978 28.4745C38.7856 29.517 39.0631 30.465 39.2627 31.1329C39.5774 32.1861 38.9459 33.3244 37.8311 33.5574C34.2202 34.3119 31.6674 34.2884 27.7869 33.5478C26.6489 33.3306 25.9856 32.1702 26.3211 31.0903C26.5271 30.4275 26.8086 29.4979 27.0974 28.4723C26.4677 28.5122 25.8205 28.3489 25.2607 27.9631C24.6516 27.5433 24.2519 26.933 24.0865 26.2674C23.9479 27.033 23.5135 27.7445 22.8189 28.2159C22.0534 28.7353 21.1338 28.8533 20.3089 28.6177C20.311 28.6346 20.3131 28.6515 20.3149 28.6685L20.9816 34.6685C21.1611 36.2836 20.022 37.7479 18.4124 37.9713C16.8028 38.1947 15.3079 37.0959 15.0408 35.493L15 35.2481L14.9591 35.493C14.692 37.0959 13.1972 38.1947 11.5876 37.9713C9.97797 37.7479 8.83886 36.2836 9.01831 34.6685L9.53564 30.0126L9.58469 28.6759C8.81254 28.8293 7.98151 28.6803 7.28467 28.1947C5.92538 27.2473 5.59144 25.3774 6.53881 24.0181C6.63747 23.8765 6.75506 23.7018 6.89204 23.498L6.91985 23.4566C7.31246 22.8723 7.84333 22.0822 8.36807 21.4365C8.74225 20.9761 9.23071 20.4355 9.82026 19.9893ZM12.5689 20.9998C11.9514 20.9998 11.4254 21.2827 11.0272 21.584C10.6209 21.8916 10.2489 22.2934 9.92016 22.6979C9.46185 23.2618 8.98121 23.9748 8.57813 24.5746L8.56449 24.595C8.42511 24.8024 8.29296 24.999 8.17961 25.1617C7.86383 25.6148 7.97514 26.2381 8.42823 26.5538C8.88133 26.8696 9.50463 26.7583 9.82042 26.3052L11.7761 23.4952L11.5316 30.1599L11.0061 34.8894C10.9463 35.4277 11.326 35.9158 11.8625 35.9903C12.399 36.0648 12.8973 35.6985 12.9864 35.1642L13.9801 29.2021L15.0059 28.9741L16.0216 29.2121L17.0136 35.1642C17.1026 35.6985 17.6009 36.0648 18.1374 35.9903C18.674 35.9158 19.0537 35.4277 18.9938 34.8894L18.3272 28.8894C18.3216 28.8394 18.3126 28.7911 18.3004 28.7446L18.2677 28.62V23.4038L18.4412 23.4769L20.1018 25.9878C20.1756 26.0994 20.2435 26.2016 20.3069 26.2949C20.617 26.7519 21.2389 26.871 21.6959 26.5609C22.1529 26.2508 22.2719 25.6289 21.9618 25.1719C21.9089 25.094 21.8418 24.9922 21.7682 24.8804L18.4412 23.4769L18.4397 23.4747L21.7659 24.877L21.7624 24.8715C21.4333 24.372 20.907 23.5744 20.3537 22.8883C20.005 22.4559 19.6058 22.0149 19.1834 21.6738C18.7902 21.3562 18.2258 20.9998 17.5654 20.9998H12.5689ZM28.8527 21.4975C29.2392 21.2017 29.755 20.9198 30.364 20.9198H35.193C35.8449 20.9198 36.3983 21.275 36.7787 21.5857C37.1889 21.9207 37.5758 22.3531 37.9132 22.7761C38.4485 23.4474 38.9576 24.2276 39.2756 24.7157L39.2788 24.7205C39.3509 24.8312 39.4167 24.9322 39.4683 25.0091C39.7744 25.4653 39.6528 26.0832 39.1966 26.3894C38.7419 26.6945 38.1263 26.5746 37.8193 26.122C37.5578 25.7366 37.0574 25.5945 36.6325 25.7849C36.2075 25.9753 35.9805 26.4433 36.094 26.895C36.5507 28.711 37.0938 30.5796 37.423 31.6814C34.0985 32.3746 31.8056 32.3592 28.1537 31.6627L28.1544 31.66C28.5028 30.5387 29.07 28.6471 29.5304 26.7951C29.6425 26.3442 29.4155 25.8777 28.9915 25.6876C28.5675 25.4976 28.0682 25.6385 27.8062 26.0222L27.7337 26.1279C27.4219 26.5802 26.8025 26.6942 26.3502 26.3824C25.8978 26.0706 25.7839 25.4512 26.0956 24.9989C26.205 24.8402 26.3326 24.6482 26.4672 24.4456L26.4717 24.4388C26.863 23.85 27.3317 23.1461 27.7787 22.59C28.0967 22.1942 28.4576 21.7999 28.8527 21.4975Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.0002 18C35.2094 18 37.0002 16.2091 37.0002 14C37.0002 11.7909 35.2094 10 33.0002 10C30.7911 10 29.0002 11.7909 29.0002 14C29.0002 16.2091 30.7911 18 33.0002 18ZM33.0002 16C34.1048 16 35.0002 15.1046 35.0002 14C35.0002 12.8954 34.1048 12 33.0002 12C31.8957 12 31.0002 12.8954 31.0002 14C31.0002 15.1046 31.8957 16 33.0002 16Z" fill="black"/>
<path d="M29.8009 37.9867C29.0561 37.8869 28.5 37.2514 28.5 36.5V35.2639C29.653 35.4097 30.7435 35.5007 31.8172 35.5378L31.4471 36.8946C31.2494 37.6196 30.5457 38.0864 29.8009 37.9867Z" fill="black"/>
<path d="M34.5528 36.8946L34.1814 35.5327C35.2556 35.4912 36.3465 35.3966 37.5 35.25V36.5C37.5 37.2514 36.9439 37.8869 36.1991 37.9867C35.4543 38.0864 34.7506 37.6196 34.5528 36.8946Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);