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 d="M23 26.5C23 27.3284 22.3284 28 21.5 28C20.6716 28 20 27.3284 20 26.5C20 25.6716 20.6716 25 21.5 25C22.3284 25 23 25.6716 23 26.5Z" fill="black"/>
<path d="M27.5 25C28.3284 25 29 24.3284 29 23.5C29 22.6716 28.3284 22 27.5 22C26.6716 22 26 22.6716 26 23.5C26 24.3284 26.6716 25 27.5 25Z" fill="black"/>
<path d="M24 21.5C24 22.3284 23.3284 23 22.5 23C21.6716 23 21 22.3284 21 21.5C21 20.6716 21.6716 20 22.5 20C23.3284 20 24 20.6716 24 21.5Z" fill="black"/>
<path d="M26 28C26.5523 28 27 27.5523 27 27C27 26.4477 26.5523 26 26 26C25.4477 26 25 26.4477 25 27C25 27.5523 25.4477 28 26 28Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M27 7C27 8.30622 26.1652 9.41746 25 9.82929V16.0619C25.8134 16.1633 26.5889 16.3869 27.3075 16.7136L30.5303 11.3856C29.7481 10.427 29.6135 9.0419 30.2945 7.92579C31.1576 6.51147 33.0038 6.06459 34.4181 6.92766C35.8324 7.79072 36.2793 9.6369 35.4162 11.0512C34.7365 12.1651 33.4469 12.6789 32.2388 12.4253L29.0102 17.7628C29.5799 18.2211 30.0855 18.7557 30.5115 19.3513L35.9629 16.3415C35.7645 15.12 36.3404 13.8528 37.4885 13.2266C38.9431 12.4333 40.7654 12.9694 41.5587 14.424C42.352 15.8786 41.8159 17.7008 40.3613 18.4941C39.2159 19.1188 37.8426 18.9192 36.9231 18.0959L31.4624 21.1109C31.6942 21.7091 31.8561 22.3421 31.9381 23H38.1707C38.5825 21.8348 39.6938 21 41 21C42.6569 21 44 22.3431 44 24C44 25.6569 42.6569 27 41 27C39.6938 27 38.5825 26.1652 38.1707 25H31.9381C31.8379 25.8038 31.6184 26.5705 31.298 27.2819L36.6171 30.5279C37.5756 29.7479 38.959 29.6142 40.0739 30.2946C41.4882 31.1576 41.9351 33.0038 41.0721 34.4181C40.209 35.8325 38.3628 36.2793 36.9485 35.4163C35.8334 34.7358 35.3197 33.4443 35.5752 32.235L30.2547 28.9883C29.8003 29.5574 29.2698 30.0631 28.6787 30.49L31.663 35.962C32.8831 35.7656 34.1481 36.3415 34.7736 37.4883C35.5669 38.9429 35.0308 40.7652 33.5762 41.5585C32.1216 42.3518 30.2993 41.8157 29.506 40.3611C28.8806 39.2144 29.0814 37.8391 29.9072 36.9196L26.9236 31.449C26.3152 31.6879 25.6705 31.8545 25 31.9381V38.1707C26.1652 38.5825 27 39.6938 27 41C27 42.6569 25.6569 44 24 44C22.3431 44 21 42.6569 21 41C21 39.6938 21.8348 38.5825 23 38.1707V31.9381C22.1962 31.8379 21.4295 31.6184 20.718 31.2979L17.4719 36.6173C18.252 37.5758 18.3857 38.9592 17.7053 40.0742C16.8422 41.4885 14.996 41.9354 13.5817 41.0723C12.1674 40.2092 11.7205 38.3631 12.5836 36.9487C13.264 35.8337 14.5556 35.32 15.7647 35.5754L19.0116 30.2547C18.4426 29.8002 17.9369 29.2698 17.51 28.6786L12.038 31.6629C12.2343 32.883 11.6584 34.1479 10.5117 34.7733C9.05711 35.5666 7.23483 35.0305 6.44153 33.5759C5.64823 32.1214 6.18431 30.2991 7.6389 29.5058C8.7857 28.8803 10.161 29.0812 11.0805 29.907L16.551 26.9235C16.3121 26.3152 16.1455 25.6705 16.0619 25H9.82929C9.41746 26.1652 8.30622 27 7 27C5.34315 27 4 25.6569 4 24C4 22.3431 5.34315 21 7 21C8.30622 21 9.41746 21.8348 9.82929 23H16.0619C16.1633 22.1868 16.3867 21.4115 16.7133 20.6931L11.3855 17.47C10.4269 18.2519 9.04201 18.3865 7.92603 17.7055C6.51172 16.8424 6.06484 14.9962 6.9279 13.5819C7.79096 12.1676 9.63714 11.7207 11.0515 12.5838C12.1655 13.2636 12.6793 14.5534 12.4254 15.7616L17.7625 18.9902C18.2208 18.4203 18.7556 17.9145 19.3514 17.4885L16.3416 12.0372C15.1201 12.2356 13.8529 11.6598 13.2267 10.5116C12.4334 9.05702 12.9695 7.23474 14.4241 6.44144C15.8787 5.64814 17.701 6.18422 18.4943 7.63881C19.1189 8.78418 18.9193 10.1575 18.0961 11.077L21.111 16.5376C21.7092 16.3058 22.3422 16.1439 23 16.0619V9.82929C21.8348 9.41746 21 8.30622 21 7C21 5.34315 22.3431 4 24 4C25.6569 4 27 5.34315 27 7ZM24 8C24.5523 8 25 7.55228 25 7C25 6.44772 24.5523 6 24 6C23.4477 6 23 6.44772 23 7C23 7.55228 23.4477 8 24 8ZM24 30C27.3137 30 30 27.3137 30 24C30 20.6863 27.3137 18 24 18C20.6863 18 18 20.6863 18 24C18 27.3137 20.6863 30 24 30ZM25 41C25 41.5523 24.5523 42 24 42C23.4477 42 23 41.5523 23 41C23 40.4477 23.4477 40 24 40C24.5523 40 25 40.4477 25 41ZM40 24C40 24.5523 40.4477 25 41 25C41.5523 25 42 24.5523 42 24C42 23.4477 41.5523 23 41 23C40.4477 23 40 23.4477 40 24ZM7 25C6.44772 25 6 24.5523 6 24C6 23.4477 6.44772 23 7 23C7.55228 23 8 23.4477 8 24C8 24.5523 7.55228 25 7 25ZM37.6576 32.3345C37.3699 32.806 37.5189 33.4214 37.9903 33.709C38.4617 33.9967 39.0771 33.8478 39.3648 33.3763C39.6525 32.9049 39.5036 32.2895 39.0321 32.0018C38.5607 31.7141 37.9453 31.8631 37.6576 32.3345ZM8.96784 15.9982C8.4964 15.7105 8.34744 15.0952 8.63513 14.6237C8.92282 14.1523 9.53821 14.0033 10.0097 14.291C10.4811 14.5787 10.63 15.1941 10.3424 15.6655C10.0547 16.137 9.43928 16.2859 8.96784 15.9982ZM9.95323 31.6607C9.68879 31.1759 9.08137 30.9972 8.5965 31.2616C8.11164 31.5261 7.93294 32.1335 8.19738 32.6183C8.46181 33.1032 9.06924 33.2819 9.5541 33.0175C10.039 32.753 10.2177 32.1456 9.95323 31.6607ZM38.4461 14.9824C38.931 14.718 39.5384 14.8967 39.8028 15.3816C40.0673 15.8664 39.8886 16.4739 39.4037 16.7383C38.9188 17.0027 38.3114 16.824 38.047 16.3392C37.7826 15.8543 37.9612 15.2469 38.4461 14.9824ZM15.6654 37.6578C15.1939 37.3701 14.5785 37.5191 14.2908 37.9905C14.0031 38.462 14.1521 39.0774 14.6235 39.3651C15.095 39.6528 15.7104 39.5038 15.9981 39.0324C16.2857 38.5609 16.1368 37.9455 15.6654 37.6578ZM32.0018 8.9676C32.2895 8.49616 32.9049 8.3472 33.3763 8.63489C33.8477 8.92257 33.9967 9.53797 33.709 10.0094C33.4213 10.4808 32.8059 10.6298 32.3345 10.3421C31.863 10.0544 31.7141 9.43904 32.0018 8.9676ZM31.661 38.0468C31.1761 38.3112 30.9974 38.9186 31.2619 39.4035C31.5263 39.8884 32.1337 40.0671 32.6186 39.8026C33.1035 39.5382 33.2821 38.9308 33.0177 38.4459C32.7533 37.961 32.1459 37.7823 31.661 38.0468ZM14.9826 9.55401C14.7181 9.06915 14.8968 8.46172 15.3817 8.19729C15.8666 7.93285 16.474 8.11155 16.7384 8.59641C17.0028 9.08127 16.8242 9.6887 16.3393 9.95314C15.8544 10.2176 15.247 10.0389 14.9826 9.55401Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);