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="M12.9134 9.40788C13.5165 7.95197 14.4004 6.6291 15.5147 5.5148L14.1005 4.10059C12.8005 5.40061 11.7693 6.94395 11.0657 8.64251C10.3621 10.3411 10 12.1616 10 14.0001C10 15.8386 10.3621 17.6591 11.0657 19.3576C11.7693 21.0562 12.8005 22.5996 14.1005 23.8996L15.5147 22.4854C14.4004 21.3711 13.5165 20.0482 12.9134 18.5923C12.3104 17.1364 12 15.5759 12 14.0001C12 12.4242 12.3104 10.8638 12.9134 9.40788Z" fill="black"/>
<path d="M32.4853 5.5148C33.5996 6.6291 34.4835 7.95197 35.0866 9.40788C35.6896 10.8638 36 12.4242 36 14.0001C36 15.5759 35.6896 17.1364 35.0866 18.5923C34.4835 20.0482 33.5996 21.3711 32.4853 22.4854L33.8995 23.8996C35.1995 22.5996 36.2308 21.0562 36.9343 19.3577C37.6379 17.6591 38 15.8386 38 14.0001C38 12.1616 37.6379 10.3411 36.9343 8.64251C36.2308 6.94396 35.1995 5.40061 33.8995 4.10059L32.4853 5.5148Z" fill="black"/>
<path d="M28.2426 9.75748C28.7998 10.3146 29.2418 10.9761 29.5433 11.704C29.8448 12.432 30 13.2122 30 14.0001C30 14.788 29.8448 15.5683 29.5433 16.2962C29.2418 17.0242 28.7998 17.6856 28.2426 18.2428L29.6569 19.657C30.3997 18.9141 30.989 18.0322 31.391 17.0616C31.7931 16.091 32 15.0507 32 14.0001C32 12.9495 31.7931 11.9093 31.391 10.9386C30.989 9.96804 30.3997 9.08613 29.6569 8.34326L28.2426 9.75748Z" fill="black"/>
<path d="M19.7574 9.75748C19.2002 10.3146 18.7583 10.9761 18.4567 11.704C18.1552 12.432 18 13.2122 18 14.0001C18 14.788 18.1552 15.5683 18.4567 16.2962C18.7583 17.0242 19.2002 17.6856 19.7574 18.2428L18.3431 19.657C17.6003 18.9141 17.011 18.0322 16.609 17.0616C16.2069 16.091 16 15.0507 16 14.0001C16 12.9495 16.2069 11.9093 16.609 10.9386C17.011 9.96804 17.6003 9.08613 18.3431 8.34326L19.7574 9.75748Z" fill="black"/>
<path d="M26 14C26 15.1046 25.1046 16 24 16C22.8954 16 22 15.1046 22 14C22 12.8954 22.8954 12 24 12C25.1046 12 26 12.8954 26 14Z" fill="black"/>
<path d="M32.6739 30.3617C33.0856 30.7299 33.1208 31.3621 32.7526 31.7737C32.3844 32.1854 31.7522 32.2206 31.3406 31.8524C30.8744 31.4354 30.3042 31.15 29.6884 31.0276C29.0088 30.8924 28.3044 30.9618 27.6642 31.2269C27.024 31.4921 26.4769 31.9412 26.0919 32.5173C25.7069 33.0935 25.5015 33.7708 25.5015 34.4637C25.5015 35.1567 25.7069 35.834 26.0919 36.4102C26.4769 36.9863 27.024 37.4354 27.6642 37.7005C28.3044 37.9657 29.0088 38.0351 29.6884 37.8999C30.1642 37.8053 30.6128 37.6134 31.0073 37.3387V35.4637H29.0049C28.4527 35.4637 28.0049 35.016 28.0049 34.4637C28.0049 33.9115 28.4527 33.4637 29.0049 33.4637H32.0073C32.5596 33.4637 33.0073 33.9115 33.0073 34.4637V37.8204C33.0073 38.105 32.886 38.3761 32.6739 38.5658C31.9417 39.2208 31.0458 39.6691 30.0786 39.8615C29.011 40.0738 27.9045 39.9648 26.8989 39.5483C25.8932 39.1318 25.0337 38.4264 24.429 37.5213C23.8242 36.6163 23.5015 35.5522 23.5015 34.4637C23.5015 33.3753 23.8242 32.3112 24.429 31.4062C25.0337 30.5011 25.8932 29.7957 26.8989 29.3792C27.9045 28.9626 29.011 28.8536 30.0786 29.066C31.0458 29.2584 31.9417 29.7067 32.6739 30.3617Z" fill="black"/>
<path d="M20 32.25C20 31.5799 19.4388 31 18.7009 31H17.1682C16.5907 31 16.1138 31.36 15.9405 31.8397C15.7529 32.3591 15.1798 32.6281 14.6603 32.4405C14.1409 32.2529 13.8719 31.6798 14.0595 31.1603C14.5174 29.8922 15.7437 29 17.1682 29H18.7009C20.5025 29 22 30.4349 22 32.25C22 33.1292 21.6487 33.9191 21.0817 34.5C21.6487 35.0809 22 35.8708 22 36.75C22 38.5651 20.5025 40 18.7009 40H17.1682C15.7437 40 14.5174 39.1078 14.0595 37.8397C13.8719 37.3202 14.1409 36.7471 14.6603 36.5595C15.1798 36.3719 15.7529 36.6409 15.9405 37.1603C16.1138 37.64 16.5907 38 17.1682 38H18.7009C19.4388 38 20 37.4201 20 36.75C20 36.0799 19.4388 35.5 18.7009 35.5H17.1682C16.616 35.5 16.1682 35.0523 16.1682 34.5C16.1682 33.9477 16.616 33.5 17.1682 33.5H18.7009C19.4388 33.5 20 32.9201 20 32.25Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 28C10 26.3431 11.3431 25 13 25H35C36.6569 25 38 26.3431 38 28V41C38 42.6569 36.6569 44 35 44H13C11.3431 44 10 42.6569 10 41V28ZM12 28C12 27.4477 12.4477 27 13 27H35C35.5523 27 36 27.4477 36 28V41C36 41.5523 35.5523 42 35 42H13C12.4477 42 12 41.5523 12 41V28Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);