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="M11.7117 8.27407C11.3772 6.73696 9.87072 5.74651 8.3224 6.05617C6.7579 6.36907 5.74327 7.89101 6.05617 9.45552L6.05831 9.46624L6.09029 9.60976L6.09223 9.6178C6.10965 9.69032 6.13292 9.78086 6.1633 9.88793C6.22406 10.102 6.31337 10.3826 6.44145 10.7176C6.69771 11.3878 7.10935 12.2763 7.7575 13.2845C8.66442 14.6952 10.0174 16.3136 12.0118 17.8849C11.8132 18.8395 11.6667 19.9611 11.6667 21.1667C11.6667 23.0618 12.1937 24.4894 13.0324 25.6749C13.8293 26.8014 14.8943 27.6827 15.8905 28.5071L15.9394 28.5476C17.2478 29.6305 18.5058 30.6806 19.4667 32.2421C20.414 33.7814 21.1112 35.8897 21.1112 39.1112C21.1112 40.7067 22.4046 42.0001 24.0001 42.0001C25.5955 42.0001 26.8889 40.7067 26.8889 39.1112C26.8889 35.8897 27.5861 33.7814 28.5334 32.2421C29.4943 30.6806 30.7524 29.6305 32.0608 28.5476L32.1096 28.5071C33.1058 27.6827 34.1708 26.8014 34.9677 25.6749C35.8064 24.4894 36.3334 23.0618 36.3334 21.1667C36.3334 19.9611 36.1869 18.8395 35.9884 17.8849C37.9827 16.3136 39.3357 14.6952 40.2426 13.2845C40.8908 12.2763 41.3024 11.3878 41.5587 10.7176C41.6867 10.3826 41.7761 10.102 41.8368 9.88793C41.8886 9.70559 41.9161 9.58814 41.9419 9.46564L41.9439 9.45552C42.2568 7.89101 41.2422 6.36907 39.6777 6.05617C38.1294 5.74651 36.6229 6.73697 36.2884 8.2741C36.2867 8.28084 36.2835 8.29309 36.2785 8.31058C36.2618 8.3695 36.2257 8.48736 36.1619 8.65411C36.0345 8.98736 35.7968 9.51556 35.3825 10.1601C34.7418 11.1568 33.6557 12.4678 31.8387 13.7791C29.8885 13.2835 27.3836 12.7757 25.0948 12.644C24.734 12.6223 24.3689 12.6112 24.0001 12.6112C23.6312 12.6112 23.2661 12.6223 22.9053 12.644C20.6165 12.7757 18.1116 13.2835 16.1614 13.7792C14.3444 12.4678 13.2584 11.1568 12.6176 10.1601C12.2033 9.51556 11.9656 8.98735 11.8382 8.65411C11.7744 8.48736 11.7383 8.36949 11.7216 8.31057C11.7166 8.29308 11.7134 8.28082 11.7117 8.27407ZM9.75861 8.70499C9.65819 8.2292 9.19281 7.9217 8.71463 8.01733C8.23617 8.11303 7.92485 8.57623 8.01562 9.05453L8.03871 9.15813C8.04928 9.20171 8.06401 9.25911 8.08377 9.32932L8.08733 9.34191C8.13284 9.50229 8.20374 9.72654 8.30956 10.0033C8.52122 10.5569 8.87264 11.3206 9.43986 12.203C10.2991 13.5396 11.6445 15.134 13.7256 16.6779L14.262 17.0758L14.1 17.7236C13.8621 18.6748 13.6667 19.8714 13.6667 21.1667C13.6667 21.8723 13.7571 22.4744 13.917 23.0035C13.9444 23.0012 13.9721 23.0001 14.0001 23.0001H26.5966C26.218 22.3748 26 21.6414 26 20.8571C26 20.4768 26.0517 20.1072 26.1485 19.7557C26.0519 19.4247 26 19.075 26 18.7143C26 17.0053 27.1542 15.5659 28.7256 15.133C27.4853 14.8965 26.1899 14.7103 24.9785 14.6407L24.9756 14.6405C24.6545 14.6211 24.3291 14.6112 24.0001 14.6112C23.671 14.6112 23.3456 14.6211 23.0245 14.6405L23.0216 14.6407C20.7432 14.7716 18.1677 15.3149 16.2206 15.8299L15.778 15.947L15.4001 15.6884C13.1293 14.1345 11.7559 12.5181 10.9353 11.2416C10.44 10.4712 10.1421 9.81828 9.9701 9.36838C9.88407 9.1434 9.82954 8.96921 9.79758 8.85658L9.7909 8.83276C9.77866 8.78862 9.77042 8.75584 9.76548 8.73527L9.76501 8.73334L9.76127 8.71762L9.75861 8.70499ZM32.3085 15.8879C33.015 15.9849 33.6499 16.3066 34.1388 16.7785L34.2745 16.6779C36.3556 15.134 37.701 13.5396 38.5603 12.203C39.1275 11.3206 39.4789 10.5569 39.6906 10.0033C39.7964 9.72654 39.8673 9.50229 39.9128 9.34192C39.9502 9.21019 39.967 9.13773 39.9837 9.05891C40.0772 8.57906 39.7654 8.11332 39.2855 8.01733C38.8073 7.9217 38.3419 8.2292 38.2415 8.70499L38.2389 8.71755L38.2351 8.7332L38.2347 8.73521C38.2288 8.75941 38.2185 8.80031 38.2025 8.85656C38.1706 8.96919 38.116 9.1434 38.03 9.36838C37.858 9.81828 37.5601 10.4712 37.0648 11.2416C36.2442 12.5181 34.8708 14.1345 32.6 15.6884L32.3085 15.8879ZM17.2145 27.0068C16.3581 26.298 15.6231 25.6844 15.0396 25.0001H32.9605C32.377 25.6844 31.642 26.298 30.7856 27.0068L30.7487 27.0373C29.4672 28.0979 27.9758 29.3321 26.8301 31.1938C25.6598 33.0955 24.8889 35.5791 24.8889 39.1112C24.8889 39.6021 24.491 40.0001 24.0001 40.0001C23.5091 40.0001 23.1112 39.6021 23.1112 39.1112C23.1112 35.5791 22.3403 33.0955 21.17 31.1938C20.0243 29.3321 18.5329 28.0979 17.2514 27.0373L17.2145 27.0068ZM33.1429 19.1428C33.1429 19.2106 33.1376 19.2772 33.1275 19.3421C33.1127 19.4374 33.0874 19.5292 33.0528 19.6164C33.1455 19.6416 33.234 19.677 33.3171 19.7212C33.7234 19.9372 34 20.3648 34 20.8571C34 21.5671 33.4244 22.1428 32.7143 22.1428C32.511 22.1428 32.3188 22.0956 32.1479 22.0116C32.0966 21.9864 32.0473 21.9579 32.0002 21.9264C31.9527 22.0088 31.8998 22.0878 31.8421 22.1628C31.4504 22.6719 30.8349 22.9999 30.1429 22.9999C28.9594 22.9999 28 22.0406 28 20.8571C28 20.4395 28.1195 20.0498 28.3261 19.7203C28.121 19.4377 28 19.0901 28 18.7143C28 17.7675 28.7675 17 29.7143 17C30.3549 17 30.9135 17.3514 31.2077 17.872C31.2308 17.9129 31.2523 17.9548 31.2721 17.9977C31.3034 17.9816 31.3354 17.9668 31.3682 17.9534C31.5189 17.8913 31.684 17.8571 31.8571 17.8571C32.5672 17.8571 33.1429 18.4328 33.1429 19.1428Z" fill="black"/>
<path d="M30 18.5C30 18.7761 29.7761 19 29.5 19C29.2239 19 29 18.7761 29 18.5C29 18.2239 29.2239 18 29.5 18C29.7761 18 30 18.2239 30 18.5Z" fill="black"/>
<path d="M31 21C31 21.5523 30.5523 22 30 22C29.4477 22 29 21.5523 29 21C29 20.4477 29.4477 20 30 20C30.5523 20 31 20.4477 31 21Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);