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.0678 20.1204C34.6441 18.735 33.2676 17.823 31.7868 18.0286C30.1457 18.2564 29 19.7715 29.2278 21.4126C29.2352 21.4653 29.2467 21.5173 29.2622 21.5682C29.5852 22.6218 30.0273 23.7085 30.432 24.6936C29.0232 24.5958 27.63 24.5001 27.412 24.5001C26.9843 24.5001 26.646 24.5932 26.5564 24.6178L26.5553 24.6181L26.552 24.619C26.4163 24.6563 26.2996 24.6969 26.2265 24.7232C26.0807 24.7757 25.9232 24.8396 25.8095 24.8858L25.7237 24.9207C25.4907 25.0156 25.259 25.1098 25.0028 25.2027C24.3412 25.4423 23.9425 25.508 23.811 25.5026C23.6966 25.4979 23.3444 25.419 22.7733 25.1921C22.5514 25.1039 22.3518 25.0165 22.1537 24.9298L22.0861 24.9002C21.9918 24.8589 21.8565 24.7998 21.732 24.7506C21.6713 24.7266 21.5654 24.6859 21.4404 24.6469C21.3634 24.6223 20.9811 24.5001 20.4969 24.5001C20.3152 24.5001 18.8235 24.5956 17.2968 24.6937C17.3166 24.6521 17.3364 24.6106 17.3561 24.5693L17.3567 24.568C17.5494 24.164 17.7317 23.7817 17.8798 23.4696C17.9332 23.3569 17.9913 23.2427 18.0575 23.1124C18.0633 23.1011 18.0691 23.0897 18.0749 23.0782C18.1458 22.9387 18.2248 22.7824 18.2997 22.6203C18.4485 22.2983 18.603 21.9081 18.6725 21.4699C18.932 19.8335 17.8157 18.2966 16.1793 18.0371C14.6587 17.796 13.4218 18.7572 12.9032 19.9445C12.4978 20.8727 12.05 21.7822 11.5904 22.7158C11.5103 22.8785 11.4298 23.0419 11.3492 23.2063C10.8108 24.3036 10.2679 25.4351 9.80587 26.6104C9.76238 26.7211 9.68898 26.9124 9.63173 27.1176L9.63093 27.1205C9.60991 27.1957 9.53126 27.4772 9.51359 27.8317C9.50674 27.9692 9.48025 28.5081 9.73426 29.1298C9.87861 29.4831 10.1633 29.9834 10.7073 30.3938C11.2842 30.829 11.9373 31.0001 12.5179 31.0001C12.7182 31.0001 14.3758 30.8936 15.9969 30.7895L17.0001 30.7252V31.9925L14.3876 33.6578C13.3366 34.3277 12.8093 35.5777 13.0628 36.7979L14.0628 41.6104C14.3879 43.1748 15.882 44.2099 17.4609 43.9645C19.0397 43.7191 20.1492 42.2793 19.984 40.6901L19.7394 38.3357L20.8391 38.0002H27.3766L28.2655 38.2896L28.0161 40.6901C27.851 42.2793 28.9605 43.7191 30.5393 43.9645C32.1181 44.2099 33.6123 43.1748 33.9373 41.6104L34.9373 36.7979C35.1816 35.6224 34.7015 34.4145 33.7169 33.7274L31.0001 31.8316V30.7474L31.65 30.7926C33.1198 30.8947 34.6371 31.0001 34.859 31.0001C36.01 31.0001 36.9133 30.3665 37.3969 29.6082C37.7696 29.0238 37.8375 28.4711 37.8567 28.2786C37.8986 27.8583 37.8411 27.5187 37.8257 27.4275L37.8255 27.4265L37.8251 27.424M22.0347 27.0507C22.6296 27.2871 23.2518 27.4814 23.7293 27.5009C24.2787 27.5234 24.9932 27.3333 25.684 27.083C25.9796 26.976 26.2435 26.8685 26.4723 26.7753L26.5625 26.7386C26.8323 26.6289 27.1143 26.5001 27.412 26.5001C27.412 26.5001 27.4116 26.5001 27.4146 26.5002C27.4229 26.5005 27.449 26.5014 27.5015 26.504C27.5638 26.5071 27.6469 26.5118 27.7492 26.5179C27.9534 26.5302 28.2256 26.5478 28.5437 26.569C29.1794 26.6115 29.9906 26.6678 30.7912 26.7233L31.8909 26.7996C32.2337 26.8234 32.5648 26.6694 32.7675 26.3918C32.9702 26.1142 33.0162 25.752 32.8893 25.4326C32.8262 25.274 32.7621 25.1133 32.6975 24.9518C32.5713 24.6366 32.441 24.3195 32.3103 24.0013C31.9104 23.0278 31.5061 22.0438 31.2018 21.0704C31.1646 20.5498 31.5373 20.0824 32.0618 20.0096C32.5588 19.9406 33.0227 20.2502 33.159 20.7179C33.1656 20.7407 33.1731 20.7633 33.1813 20.7856C33.4942 21.6302 33.8869 22.495 34.2638 23.3251C34.4254 23.6809 34.584 24.0303 34.7323 24.369C35.244 25.5383 35.6658 26.6487 35.8531 27.7572L35.8536 27.7602C35.8602 27.7995 35.8817 27.9287 35.8666 28.0799C35.8599 28.1464 35.8368 28.3349 35.7106 28.5328C35.5449 28.7927 35.2398 29.0001 34.859 29.0001C34.859 29.0001 34.8601 29 34.856 28.9999C34.8473 28.9996 34.823 28.9987 34.7763 28.9964C34.7168 28.9934 34.6371 28.9889 34.5387 28.9829C34.3423 28.9711 34.0796 28.9541 33.7718 28.9335C33.1565 28.8924 32.368 28.8376 31.5825 28.7831L30.0691 28.6781C29.7926 28.659 29.5205 28.7555 29.3178 28.9447C29.1152 29.1338 29.0001 29.3986 29.0001 29.6758V32.3532C29.0001 32.68 29.1598 32.9862 29.4279 33.1733L32.5723 35.3675C32.9005 35.5965 33.0606 35.9992 32.9792 36.391L31.9792 41.2035C31.8708 41.725 31.3728 42.07 30.8465 41.9882C30.3202 41.9064 29.9504 41.4265 30.0054 40.8968L30.3384 37.6923C30.3871 37.2233 30.1016 36.784 29.6533 36.638L27.8448 36.0493C27.7448 36.0167 27.6404 36.0002 27.5352 36.0002H20.6899C20.591 36.0002 20.4927 36.0148 20.3981 36.0437L18.3678 36.6632C17.9102 36.8029 17.6156 37.2471 17.665 37.723L17.9947 40.8968C18.0498 41.4265 17.68 41.9064 17.1537 41.9882C16.6274 42.07 16.1294 41.725 16.021 41.2035L15.021 36.391C14.9365 35.9843 15.1123 35.5676 15.4626 35.3443L18.5376 33.3842C18.8257 33.2006 19.0001 32.8826 19.0001 32.541V29.659C19.0001 29.3827 18.8858 29.1187 18.6843 28.9297C18.4827 28.7406 18.212 28.6434 17.9362 28.661L16.1018 28.7787C15.2369 28.8342 14.3678 28.89 13.6941 28.9319C13.3571 28.9529 13.0704 28.9703 12.8582 28.9824C12.7519 28.9885 12.6662 28.9931 12.6029 28.9962C12.5578 28.9984 12.5329 28.9994 12.5224 28.9998C12.5156 29 12.5147 29.0001 12.5179 29.0001C12.3221 29.0001 12.1039 28.9421 11.9118 28.7972C11.7306 28.6604 11.6348 28.4935 11.5857 28.3734C11.4996 28.1626 11.5088 27.9781 11.5111 27.9318C11.5175 27.8027 11.5477 27.6925 11.5572 27.6586L11.5581 27.6554C11.5866 27.5532 11.6288 27.44 11.6672 27.3422C12.0969 26.2491 12.6082 25.1808 13.1447 24.0873C13.2229 23.9278 13.3018 23.7676 13.3811 23.6066C13.84 22.6746 14.3107 21.7187 14.736 20.745C14.9764 20.1945 15.4416 19.9451 15.8661 20.0124C16.4116 20.0989 16.7837 20.6112 16.6972 21.1567C16.6694 21.332 16.6001 21.5304 16.4842 21.7814C16.4267 21.9057 16.3632 22.0319 16.2919 22.1722C16.2857 22.1844 16.2794 22.1968 16.273 22.2093C16.2092 22.3349 16.1386 22.4736 16.0727 22.6125C15.9258 22.9224 15.7444 23.3026 15.5513 23.7074C15.29 24.2553 15.014 24.8341 14.759 25.3729C14.6076 25.693 14.6367 26.0693 14.8356 26.3623C15.0345 26.6553 15.3735 26.8212 15.7269 26.7986L17.0683 26.7125C17.9091 26.6585 18.7429 26.605 19.3857 26.5649C19.7072 26.5449 19.9794 26.5283 20.1803 26.5168C20.2809 26.511 20.3617 26.5066 20.4211 26.5037C20.4606 26.5017 20.4829 26.5008 20.4931 26.5004C20.501 26.5001 20.5015 26.5001 20.4969 26.5001C21.0202 26.5001 21.5727 26.8671 22.0347 27.0507Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.6415 4.0665C24.1571 3.8685 24.7356 4.12594 24.9336 4.64151L26.1411 7.78583C26.2701 8.12155 26.2088 8.50064 25.9807 8.77865C25.7526 9.05667 25.3928 9.19079 25.0383 9.12992L24.0573 8.96141L24.697 10.2674C24.9399 10.7633 24.7348 11.3624 24.2388 11.6053C23.7428 11.8482 23.1438 11.6431 22.9009 11.1471L21.4008 8.08462C21.2356 7.74736 21.2733 7.34598 21.4984 7.04537C21.7235 6.74476 22.098 6.5956 22.4682 6.65917L23.6436 6.86106L23.0665 5.35854C22.8685 4.84297 23.126 4.2645 23.6415 4.0665ZM13.3 4.28602C13.6943 3.89937 14.3275 3.90563 14.7141 4.29999L18.6358 8.29999C18.9177 8.58752 18.9997 9.01607 18.8438 9.38732C18.6878 9.75857 18.3244 10.0001 17.9218 10.0001H16.439L17.7455 11.2879C18.1388 11.6756 18.1434 12.3088 17.7557 12.7021C17.368 13.0954 16.7348 13.1 16.3415 12.7123L13.298 9.71225C13.0091 9.4274 12.9209 8.99616 13.0748 8.62072C13.2287 8.24528 13.5943 8.00008 14 8.00008H15.5409L13.286 5.70017C12.8993 5.3058 12.9056 4.67267 13.3 4.28602ZM34.7071 4.29297C35.0977 4.6835 35.0977 5.31666 34.7071 5.70719L32.4142 8.00008H33.9218C34.3252 8.00008 34.6891 8.24246 34.8445 8.6147C35 8.98695 34.9166 9.41614 34.633 9.70305L31.6678 12.703C31.2795 13.0958 30.6464 13.0995 30.2536 12.7113C29.8608 12.3231 29.8571 11.6899 30.2453 11.2971L31.5273 10.0001H30C29.5956 10.0001 29.2309 9.75644 29.0761 9.38276C28.9214 9.00909 29.0069 8.57897 29.2929 8.29297L33.2929 4.29297C33.6834 3.90245 34.3166 3.90245 34.7071 4.29297Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 21.0001C25.3807 21.0001 26.5 19.8808 26.5 18.5001C26.5 17.1194 25.3807 16.0001 24 16.0001C22.6193 16.0001 21.5 17.1194 21.5 18.5001C21.5 19.8808 22.6193 21.0001 24 21.0001ZM24 23.0001C26.4853 23.0001 28.5 20.9854 28.5 18.5001C28.5 16.0148 26.4853 14.0001 24 14.0001C21.5148 14.0001 19.5 16.0148 19.5 18.5001C19.5 20.9854 21.5148 23.0001 24 23.0001Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);