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="M18.1045 16.2573C18.1045 16.8096 17.6567 17.2573 17.1045 17.2573C16.5522 17.2573 16.1045 16.8096 16.1045 16.2573C16.1045 15.705 16.5522 15.2573 17.1045 15.2573C17.6567 15.2573 18.1045 15.705 18.1045 16.2573Z" fill="black"/>
<path d="M15.1873 17.4941C15.4635 17.4941 15.6873 17.2703 15.6873 16.9941C15.6873 16.718 15.4635 16.4941 15.1873 16.4941C14.9112 16.4941 14.6873 16.718 14.6873 16.9941C14.6873 17.2703 14.9112 17.4941 15.1873 17.4941Z" fill="black"/>
<path d="M16.4205 17.9761C16.4205 18.2522 16.1966 18.4761 15.9205 18.4761C15.6444 18.4761 15.4205 18.2522 15.4205 17.9761C15.4205 17.6999 15.6444 17.4761 15.9205 17.4761C16.1966 17.4761 16.4205 17.6999 16.4205 17.9761Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.69277 21.9942C10.8729 23.5213 14.3197 22.8349 17.3914 20.4611C20.4632 18.0873 21.9966 14.925 20.8165 13.3979C19.6363 11.8708 16.1895 12.5572 13.1178 14.931C10.0461 17.3047 8.51263 20.4671 9.69277 21.9942ZM12.4422 20.729C13.4726 20.5238 14.8238 19.9178 16.1685 18.8786C17.5132 17.8394 18.4404 16.6847 18.8988 15.7394C19.2077 15.1023 19.2226 14.7692 19.2109 14.6387C19.0875 14.5945 18.7615 14.5248 18.0671 14.6631C17.0367 14.8683 15.6854 15.4743 14.3407 16.5135C12.996 17.5526 12.0688 18.7074 11.6104 19.6527C11.3015 20.2898 11.2867 20.6229 11.2983 20.7534C11.4217 20.7976 11.7478 20.8673 12.4422 20.729Z" fill="black"/>
<path d="M27.7752 30.3802C28.3275 30.3802 28.7752 29.9325 28.7752 29.3802C28.7752 28.8279 28.3275 28.3802 27.7752 28.3802C27.2229 28.3802 26.7752 28.8279 26.7752 29.3802C26.7752 29.9325 27.2229 30.3802 27.7752 30.3802Z" fill="black"/>
<path d="M29.8234 30.4788C29.8234 30.7291 29.6205 30.9319 29.3703 30.9319C29.12 30.9319 28.9172 30.7291 28.9172 30.4788C28.9172 30.2286 29.12 30.0257 29.3703 30.0257C29.6205 30.0257 29.8234 30.2286 29.8234 30.4788Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M31.387 27.5355C34.6736 29.52 36.5382 32.4532 35.5516 34.0872C34.565 35.7211 31.1009 35.437 27.8143 33.4525C24.5277 31.4681 22.6632 28.5348 23.6498 26.9009C24.6363 25.2669 28.1004 25.5511 31.387 27.5355ZM30.3533 29.2476C31.7897 30.115 32.8287 31.1422 33.3839 32.0157C33.7447 32.5834 33.8045 32.9025 33.8111 33.0363C33.6896 33.0927 33.3794 33.1884 32.709 33.1335C31.6775 33.0488 30.2846 32.6078 28.8481 31.7404C27.4116 30.8731 26.3727 29.8458 25.8175 28.9724C25.4566 28.4047 25.3969 28.0855 25.3903 27.9518C25.5117 27.8953 25.822 27.7996 26.4924 27.8546C27.5239 27.9392 28.9168 28.3803 30.3533 29.2476Z" fill="black"/>
<path d="M28.9516 17.5108C29.5039 17.5108 29.9516 17.063 29.9516 16.5108C29.9516 15.9585 29.5039 15.5108 28.9516 15.5108C28.3993 15.5108 27.9516 15.9585 27.9516 16.5108C27.9516 17.063 28.3993 17.5108 28.9516 17.5108Z" fill="black"/>
<path d="M28.6783 14.5008C28.6783 14.8874 28.3649 15.2008 27.9783 15.2008C27.5917 15.2008 27.2783 14.8874 27.2783 14.5008C27.2783 14.1142 27.5917 13.8008 27.9783 13.8008C28.3649 13.8008 28.6783 14.1142 28.6783 14.5008Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.2184 23.5407C33.9676 22.7225 34.0513 19.207 32.4055 15.6887C30.7597 12.1704 28.0075 9.9815 26.2584 10.7997C24.5092 11.6179 24.4255 15.1334 26.0713 18.6517C27.7171 22.1701 30.4693 24.3589 32.2184 23.5407ZM31.5856 20.5796C31.6107 19.5285 31.3145 18.0765 30.5939 16.5361C29.8734 14.9958 28.9487 13.8378 28.1258 13.1833C27.5702 12.7415 27.2479 12.6545 27.1181 12.6375C27.0479 12.748 26.9081 13.0512 26.8912 13.7608C26.8661 14.812 27.1623 16.264 27.8829 17.8043C28.6034 19.3446 29.5281 20.5027 30.351 21.1571C30.9066 21.599 31.2289 21.6859 31.3587 21.7029C31.4289 21.5924 31.5687 21.2892 31.5856 20.5796Z" fill="black"/>
<path d="M16.7688 32.3177C17.3211 32.3177 17.7688 31.87 17.7688 31.3177C17.7688 30.7654 17.3211 30.3177 16.7688 30.3177C16.2165 30.3177 15.7688 30.7654 15.7688 31.3177C15.7688 31.87 16.2165 32.3177 16.7688 32.3177Z" fill="black"/>
<path d="M18.7307 32.4945C18.7307 32.7447 18.5278 32.9476 18.2776 32.9476C18.0273 32.9476 17.8245 32.7447 17.8245 32.4945C17.8245 32.2442 18.0273 32.0413 18.2776 32.0413C18.5278 32.0413 18.7307 32.2442 18.7307 32.4945Z" fill="black"/>
<path d="M15.8969 29.9965C16.2835 29.9965 16.5969 29.6831 16.5969 29.2965C16.5969 28.9099 16.2835 28.5965 15.8969 28.5965C15.5103 28.5965 15.1969 28.9099 15.1969 29.2965C15.1969 29.6831 15.5103 29.9965 15.8969 29.9965Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.5677 30.6184C22.3518 34.1675 22.3678 37.7637 20.6033 38.6506C18.8389 39.5376 15.9622 37.3795 14.1781 33.8305C12.394 30.2814 12.3781 26.6853 14.1425 25.7983C15.907 24.9113 18.7836 27.0694 20.5677 30.6184ZM18.7808 31.5167C19.5643 33.0754 19.9115 34.5581 19.9163 35.6417C19.9197 36.4259 19.7637 36.741 19.6952 36.8442C19.5716 36.8376 19.2256 36.7748 18.5983 36.3042C17.7315 35.6539 16.7486 34.4909 15.9651 32.9322C15.1815 31.3735 14.8344 29.8909 14.8296 28.8072C14.8261 28.023 14.9822 27.7079 15.0506 27.6048C15.1742 27.6114 15.5202 27.6741 16.1475 28.1447C17.0144 28.795 17.9973 29.958 18.7808 31.5167Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44ZM24 42C33.9411 42 42 33.9411 42 24C42 14.0589 33.9411 6 24 6C14.0589 6 6 14.0589 6 24C6 33.9411 14.0589 42 24 42Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);