build method

  1. @override
Widget build(
  1. BuildContext context
)
override

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:

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="M23.0022 6.64949C23.0022 6.29642 22.6797 6.0301 22.3381 6.11956C18.1086 7.22739 15.0022 10.9084 15.0022 15.2787C15.0022 16.997 15.4825 18.6088 16.3223 19.9995C16.3493 20.0441 16.3766 20.0884 16.4042 20.1326C16.3513 20.1333 16.2983 20.1345 16.2453 20.1362C15.0437 20.174 13.8379 20.4483 12.6899 20.9836C8.72911 22.8306 6.70575 27.2016 7.48921 31.503C7.55248 31.8504 7.93016 32.0302 8.25015 31.881C8.4755 31.7759 8.60263 31.5352 8.5811 31.2875C8.33365 28.4404 9.858 25.6143 12.5983 24.3365C13.4044 23.9606 14.2454 23.7514 15.0826 23.6948C15.0983 23.6938 15.114 23.6927 15.1298 23.6918C15.7891 23.6517 16.4455 23.7061 17.0801 23.8481C19.1267 24.3059 20.946 25.6746 21.9008 27.7223C22.6271 29.2797 22.731 30.9678 22.3146 32.5061C22.3065 32.536 22.2983 32.5657 22.2898 32.5955C22.1147 33.21 21.8563 33.7996 21.5211 34.3462C20.828 35.4764 19.8065 36.4225 18.515 37.0248C15.7747 38.3026 12.6299 37.6538 10.608 35.6341C10.4321 35.4584 10.166 35.4011 9.94062 35.5062C9.62063 35.6554 9.51558 36.0603 9.74101 36.332C12.5325 39.6971 17.1815 40.9567 21.1423 39.1098C22.7812 38.3456 24.0883 37.1492 25.0022 35.7045C25.9161 37.1492 27.2233 38.3456 28.8621 39.1098C32.823 40.9567 37.4719 39.6971 40.2634 36.332C40.4889 36.0603 40.3838 35.6554 40.0638 35.5062C39.8385 35.4011 39.5724 35.4584 39.3965 35.6341C37.3745 37.6538 34.2298 38.3026 31.4894 37.0248C30.1979 36.4225 29.1765 35.4764 28.4833 34.3462C28.4713 34.3266 28.4594 34.307 28.4476 34.2873C28.1138 33.7308 27.8589 33.1308 27.6898 32.5061C27.2735 30.9678 27.3774 29.2797 28.1036 27.7223C29.0585 25.6746 30.8777 24.3059 32.9243 23.8481C32.957 23.8408 32.9898 23.8337 33.0226 23.8268C33.6417 23.6976 34.2806 23.6514 34.9218 23.6948C35.759 23.7514 36.6 23.9606 37.4061 24.3365C40.1464 25.6143 41.6708 28.4404 41.4233 31.2875C41.4018 31.5352 41.5289 31.7759 41.7543 31.881C42.0743 32.0302 42.452 31.8504 42.5152 31.503C43.2987 27.2016 41.2753 22.8306 37.3145 20.9836C36.1665 20.4483 34.9607 20.174 33.7591 20.1362C33.7177 20.1349 33.6764 20.1339 33.635 20.1332C33.6234 20.1329 33.6118 20.1328 33.6002 20.1326C33.6279 20.0885 33.6552 20.0441 33.6821 19.9995C34.522 18.6088 35.0022 16.9971 35.0022 15.2787C35.0022 10.9084 31.8959 7.22739 27.6663 6.11956C27.3248 6.0301 27.0022 6.29642 27.0022 6.64949C27.0022 6.89813 27.1667 7.11508 27.4002 7.20025C30.0852 8.17922 32.0022 10.7551 32.0022 13.7787C32.0022 14.9788 31.7003 16.1083 31.1682 17.0954C31.1646 17.1021 31.161 17.1087 31.1574 17.1153C30.8398 17.7 30.4413 18.2343 29.977 18.7033C28.7084 19.9848 26.948 20.7787 25.0022 20.7787C23.0565 20.7787 21.2961 19.9848 20.0274 18.7033C19.9964 18.6719 19.9656 18.6402 19.9352 18.6083C19.505 18.1571 19.1345 17.6486 18.8363 17.0954C18.3042 16.1082 18.0022 14.9787 18.0022 13.7787C18.0022 10.7551 19.9193 8.17922 22.6042 7.20025C22.8378 7.11508 23.0022 6.89813 23.0022 6.64949ZM27.0022 24.9688C27.0022 23.8642 26.1068 22.9688 25.0022 22.9688C23.8977 22.9688 23.0022 23.8642 23.0022 24.9688C23.0022 26.0733 23.8977 26.9688 25.0022 26.9688C26.1068 26.9688 27.0022 26.0733 27.0022 24.9688Z" fill="black"/>
<path d="M15.029 25.7072C15.2679 28.9794 17.0813 31.8146 19.715 33.4583C20.0962 32.8865 20.3557 32.2417 20.4778 31.5674C18.6231 30.2932 17.3324 28.2574 17.0571 25.911C16.4093 25.7071 15.7191 25.6339 15.029 25.7072Z" fill="black"/>
<path d="M30.2894 33.4583C32.9231 31.8146 34.7365 28.9794 34.9753 25.7072C34.2853 25.6339 33.5951 25.7071 32.9473 25.9111C32.672 28.2574 31.3813 30.2932 29.5266 31.5674C29.6487 32.2417 29.9083 32.8865 30.2894 33.4583Z" fill="black"/>
<path d="M25.0022 14.9688C23.3955 14.9688 21.8773 15.3477 20.532 16.021C20.8444 16.6425 21.2825 17.1899 21.813 17.6297C22.7901 17.2045 23.8686 16.9688 25.0022 16.9688C26.1358 16.9688 27.2143 17.2045 28.1914 17.6297C28.722 17.1899 29.1601 16.6426 29.4724 16.0211C28.1272 15.3477 26.609 14.9688 25.0022 14.9688Z" fill="black"/>
</svg>
''',
      colorFilter:
          color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
      width: width,
      height: height,
    );