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="M14.7817 20.4114L20.8972 19.4537L16.9276 15.0578L14.7817 20.4114Z" fill="black"/>
<path d="M20.2753 15.8371L22.0859 12.4729L25.5135 14.2498L23.703 17.614L20.2753 15.8371Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M28.1439 20.5443C27.5321 20.9702 26.8085 21.1981 26.0678 21.1981C25.5077 21.1981 25.3442 21.0678 25.0334 20.8202C24.9331 20.7403 24.8174 20.6482 24.6682 20.5443C24.4965 20.7299 24.4173 20.8988 24.3469 21.0493C24.2411 21.2751 24.1548 21.4593 23.804 21.5963C23.1801 21.9098 22.655 22.3954 22.288 22.998C21.9211 23.6005 21.727 24.2958 21.7279 25.0051V28.9999H16.8496C16.7503 28.1441 16.4642 27.3218 16.0123 26.5936C15.5604 25.8654 14.9542 25.2498 14.2382 24.7921C13.6168 24.5197 13.0804 24.0792 12.6868 23.5182C12.2933 22.9573 12.0577 22.2973 12.0055 21.6096C11.3587 20.9113 10.9989 19.9868 11.0001 19.0263C10.9951 18.1981 11.2617 17.392 11.7574 16.736C11.6662 16.4114 11.6222 16.0749 11.6268 15.7373C11.6256 14.9298 11.8787 14.1433 12.3488 13.4937L14.2382 12.1287C14.5281 11.464 15.0004 10.899 15.5982 10.5021C16.1959 10.1051 16.8936 9.8931 17.6069 9.8916C17.9015 9.89345 18.195 9.92918 18.4817 9.99813C19.0886 9.42154 19.868 9.06993 20.6945 8.99989L25.6673 9.285C26.5532 9.50841 27.3277 10.056 27.8435 10.8237H28.1047L30.4241 11.6515C31.0819 12.1893 31.5397 12.9402 31.7215 13.7798C32.5174 14.1323 33.1705 14.7528 33.5715 15.5376C33.9725 16.3224 34.097 17.2239 33.9241 18.0911C33.7513 18.9583 33.2917 19.7387 32.6221 20.3016L30.246 21.1835C29.498 21.1923 28.765 20.9695 28.1439 20.5443ZM30.0533 19.7291C29.6428 19.7044 29.25 19.5789 28.9093 19.3704L28.1377 18.8429C27.9156 19.0142 27.397 19.3907 27.0995 19.5263C26.7277 19.6957 25.9091 19.7465 25.9091 19.7465C25.9091 19.7465 25.295 19.2329 24.5041 18.7214C24.3876 18.8466 24.0808 19.1761 23.7853 19.4924C23.4898 19.8087 23.3111 20.1532 23.2587 20.2859C22.995 20.4205 22.3623 20.8033 21.941 21.2574C21.4144 21.825 20.4502 23.0238 20.4502 24.9771V27.5551H17.8629C17.6128 26.6627 16.8757 24.9175 15.1388 23.7183L15.1427 23.715C15.0522 23.6507 14.9602 23.5887 14.8668 23.529L14.7862 23.4775L14.6998 23.4396C14.2786 23.255 13.9323 22.9639 13.6876 22.615C13.4439 22.2677 13.3084 21.8751 13.2786 21.4816L13.2372 20.9367L12.8875 20.5592C12.4789 20.118 12.2772 19.5657 12.2779 19.0241L12.2779 19.0182L12.2778 19.0123C12.2751 18.5477 12.4235 18.0751 12.7286 17.6714L13.1905 17.06L12.9751 16.2935C12.9253 16.1165 12.902 15.9356 12.9044 15.7556L12.9046 15.743L12.9046 15.7305C12.904 15.333 13.0113 14.9306 13.2294 14.5687L15.2263 13.126L15.3841 12.7643C15.557 12.3678 15.8492 12.0076 16.2449 11.7448C16.6401 11.4824 17.1126 11.3352 17.6046 11.3333C17.8111 11.3349 18.0163 11.3602 18.2161 11.4082L18.8259 11.5548L19.3034 11.1012C19.6787 10.7446 20.1734 10.5068 20.7175 10.4447L25.4845 10.718C26.0536 10.8855 26.5225 11.2423 26.8264 11.6946L27.2099 12.2654H27.9079L29.8212 12.9482C30.1661 13.2799 30.3879 13.6925 30.4804 14.1196L30.6382 14.8486L31.2559 15.1221C31.8014 15.3636 32.2194 15.7757 32.4653 16.2571C32.7089 16.7338 32.7782 17.2641 32.6777 17.7688C32.5881 18.2184 32.3617 18.6537 32.0053 19.0047L30.0533 19.7291Z" fill="black"/>
<path d="M33.978 23.963C33.9787 24.7914 33.3077 25.4636 32.4793 25.4642C31.6508 25.4649 30.9787 24.7939 30.978 23.9655C30.9774 23.137 31.6484 22.4649 32.4768 22.4642C33.3052 22.4636 33.9774 23.1346 33.978 23.963Z" fill="black"/>
<path d="M16.985 32.4769L20.985 32.4737L20.9834 30.4737L16.9834 30.4769L16.985 32.4769Z" fill="black"/>
<path d="M20.9882 36.4737L16.9882 36.4769L16.9866 34.4769L20.9866 34.4737L20.9882 36.4737Z" fill="black"/>
<path d="M16.9916 40.4769L20.9916 40.4737L20.99 38.4737L16.99 38.4769L16.9916 40.4769Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.9431 38.8043C25.7448 38.6599 24.9428 38.4533 24.9428 38.4533L24.9456 41.8865C24.9456 41.8865 24.1117 44.6227 19.3734 44.6266C17.1425 44.8106 13.3225 43.3079 12.3085 41.1856L12.3015 32.6916C8.73164 29.9452 5.97818 24.2438 5.97425 19.4428C5.97098 15.4525 7.58292 11.6242 10.4555 8.80023C13.328 5.97626 17.2259 4.38789 21.2915 4.38456C24.3962 4.37856 27.4646 5.03895 30.2818 6.31947C32.5019 7.23492 34.4462 8.69308 35.9294 10.555C37.2841 12.5111 38.0359 14.8088 38.0949 17.1733C38.1074 17.7065 38.101 18.2595 38.0944 18.8227C38.0707 20.8602 38.0455 23.031 38.9095 24.8734C38.9095 24.8734 41.4478 27.2239 41.1149 29.1117C40.7819 30.9995 37.4795 31.522 37.4795 31.522C37.4857 39.1152 30.4841 39.2311 26.9431 38.8043ZM37.0987 25.7225L37.2644 26.0757L37.5473 26.3378L37.5484 26.3387L37.5566 26.3466L37.5781 26.3673L37.612 26.4005C37.6637 26.4516 37.7421 26.531 37.8375 26.6334C38.0312 26.8413 38.28 27.1282 38.5139 27.4532C38.7532 27.7856 38.9401 28.1071 39.0496 28.3853C39.1196 28.5632 39.1383 28.6732 39.1432 28.7268C39.13 28.7413 39.1107 28.7608 39.0832 28.785C38.9468 28.9054 38.7154 29.0466 38.3936 29.1826C38.0837 29.3136 37.7658 29.4082 37.517 29.4703C37.3955 29.5005 37.2975 29.5213 37.2343 29.5338L37.1944 29.5415L37.1687 29.5462L37.1593 29.5478L35.4781 29.8138L35.4795 31.5236C35.4812 33.6199 34.8536 34.7647 34.1402 35.4486C33.3742 36.1828 32.2598 36.6228 30.9224 36.8201C29.5964 37.0157 28.2229 36.9463 27.1462 36.8143C26.6158 36.7493 26.1759 36.6714 25.8735 36.6111C25.7227 36.5809 25.6073 36.5554 25.5331 36.5383C25.496 36.5297 25.4693 36.5233 25.4538 36.5195L25.4417 36.5165L25.4404 36.5162L25.4394 36.5159L22.9407 35.8723L22.9452 41.4077C22.8787 41.4981 22.7795 41.6129 22.6368 41.7349C22.2431 42.0715 21.3281 42.625 19.3718 42.6266L19.2903 42.6267L19.2091 42.6334C18.5351 42.689 17.3705 42.4763 16.2117 41.95C15.2647 41.5199 14.6332 41.0237 14.308 40.6217L14.3007 31.7062L13.521 31.1064C12.0436 29.9698 10.6401 28.1352 9.60427 25.9734C8.57078 23.8167 7.97592 21.4855 7.97425 19.4412C7.97142 15.9935 9.36381 12.678 11.8576 10.2265C14.3526 7.77361 17.746 6.38747 21.2932 6.38456L21.2954 6.38456C24.1142 6.37911 26.899 6.97877 29.4543 8.14021L29.4866 8.1549L29.5194 8.16844C31.4072 8.94687 33.0588 10.1799 34.3229 11.7486C35.4329 13.3737 36.0465 15.272 36.0955 17.2216C36.1071 17.7166 36.1011 18.2305 36.0946 18.7963L36.0916 19.0627C36.0845 19.7183 36.0803 20.4316 36.1122 21.1531C36.1756 22.5851 36.3843 24.1992 37.0987 25.7225Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);