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="M21.5843 10.0874L21.5782 10.0928C21.574 10.0194 21.5698 9.94163 21.5654 9.85905L21.557 9.70141C21.521 9.04058 21.4654 8.0406 21.0591 7.25051C20.8385 6.8214 20.4962 6.41208 19.9757 6.15329C19.4613 5.89747 18.8729 5.83854 18.245 5.925C17.6883 6.00166 17.1945 6.22589 16.8047 6.60348C16.4226 6.97362 16.1957 7.43726 16.0709 7.91064C15.8285 8.8293 15.9314 9.92695 16.1818 10.9837C16.6881 13.1199 17.9194 15.5841 19.3039 17.2603C19.8366 17.9052 20.0001 18.877 20.0001 19.2956V21.5L22.0001 22V20.685C22.8827 20.357 23.4789 20.207 24.038 20.1955C24.5799 20.1844 25.1584 20.3035 26.0001 20.6513V22L28.0001 21.5L28.0001 19.2956C28.0001 18.877 28.1636 17.9052 28.6963 17.2603C30.0715 15.5953 31.3642 13.1422 31.9358 11.0123C32.2179 9.96102 32.3592 8.86383 32.1474 7.94184C32.0381 7.46562 31.8243 6.99328 31.4453 6.61447C31.0583 6.22759 30.5621 6.00178 30.0045 5.925C29.3767 5.83854 28.7883 5.89747 28.2738 6.15329C27.7534 6.41208 27.4111 6.8214 27.1904 7.25051C26.7842 8.0406 26.7286 9.04058 26.6926 9.70141L26.6841 9.85903C26.6798 9.94162 26.6756 10.0194 26.6714 10.0928L26.6653 10.0874C26.1879 9.66212 25.5561 9.51729 25.1302 9.45488C24.8041 9.4071 24.4873 9.39377 24.2495 9.39006V9.38864L24.2369 9.38864C24.2036 9.38863 24.1661 9.38863 24.1248 9.38883C24.0836 9.38863 24.0462 9.38863 24.0129 9.38864L24.0001 9.38864V9.39006C23.7623 9.39377 23.4454 9.4071 23.1193 9.45488C22.6935 9.51729 22.0617 9.66212 21.5843 10.0874ZM22.9147 11.5807C22.9153 11.5802 22.9236 11.5734 22.9436 11.5624C22.9579 11.5544 22.9766 11.5453 23 11.5355V16H25V11.462C25.0782 11.4785 25.1466 11.4974 25.2044 11.518C25.2502 11.5345 25.2834 11.5499 25.306 11.5624C25.326 11.5735 25.3344 11.5803 25.335 11.5809C25.7583 11.9579 26.188 12.2759 26.6192 12.4201C26.8509 12.4977 27.1459 12.5466 27.4634 12.4691C27.7982 12.3874 28.0479 12.1922 28.2164 11.9732C28.5014 11.6029 28.578 11.1307 28.6142 10.8471C28.6499 10.5673 28.6668 10.2448 28.6821 9.95223L28.6896 9.81013C28.7302 9.06395 28.7917 8.51011 28.9691 8.16501C29.0403 8.02653 29.1064 7.97291 29.1644 7.9441C29.2283 7.91232 29.3881 7.85899 29.7317 7.9063C29.9126 7.93121 29.99 7.98762 30.0314 8.02894C30.0808 8.07833 30.1501 8.18017 30.1982 8.38958C30.3014 8.83886 30.2551 9.55868 30.0042 10.4939C29.5096 12.3368 28.3539 14.5343 27.1543 15.9867C26.4846 16.7974 26.183 17.7918 26.0652 18.5403C25.3509 18.3021 24.6867 18.1818 23.9969 18.1959C23.3165 18.2099 22.6534 18.355 21.9421 18.586C21.8294 17.8326 21.5293 16.814 20.8459 15.9867C19.6556 14.5455 18.5632 12.3591 18.1279 10.5225C17.9076 9.59276 17.8853 8.87338 18.0047 8.42078C18.0607 8.20854 18.1364 8.09799 18.1963 8.03993C18.2486 7.98932 18.3361 7.93133 18.5179 7.9063C18.8614 7.85899 19.0213 7.91232 19.0852 7.9441C19.1432 7.97291 19.2093 8.02653 19.2805 8.16501C19.4579 8.51011 19.5193 9.06395 19.5599 9.81013L19.5675 9.95218C19.5828 10.2448 19.5997 10.5673 19.6354 10.8471C19.6715 11.1307 19.7482 11.6029 20.0331 11.9732C20.2017 12.1922 20.4514 12.3874 20.7862 12.4691C21.1037 12.5466 21.3987 12.4977 21.6304 12.4201C22.0616 12.2759 22.4914 11.9578 22.9147 11.5807Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 42C26.2091 42 27.9999 40.2092 28 38.0001L28.0001 35.8333L26.0001 33.6667L26.0001 35.315C25.1175 35.643 24.5214 35.793 23.9623 35.8045C23.4204 35.8156 22.8418 35.6965 22.0001 35.3487V33.6667L20.0001 35.8334V38C20.0001 40.2091 21.7909 42 24 42ZM24 40C22.8955 40 22.0001 39.1046 22 38.0001L22.0001 37.4811C22.6898 37.7051 23.3346 37.8178 24.0033 37.8041C24.6652 37.7905 25.3107 37.6528 26.0001 37.4327V38C26.0001 39.1046 25.1046 40 24 40Z" fill="black"/>
<path d="M11 19C11.5523 19 12 18.5523 12 18C12 17.4477 11.5523 17 11 17C10.4477 17 10 17.4477 10 18C10 18.5523 10.4477 19 11 19Z" fill="black"/>
<path d="M14 22C14 22.5523 13.5523 23 13 23C12.4477 23 12 22.5523 12 22C12 21.4477 12.4477 21 13 21C13.5523 21 14 21.4477 14 22Z" fill="black"/>
<path d="M11 27C11.5523 27 12 26.5523 12 26C12 25.4477 11.5523 25 11 25C10.4477 25 10 25.4477 10 26C10 26.5523 10.4477 27 11 27Z" fill="black"/>
<path d="M17 31C17 31.5523 16.5523 32 16 32C15.4477 32 15 31.5523 15 31C15 30.4477 15.4477 30 16 30C16.5523 30 17 30.4477 17 31Z" fill="black"/>
<path d="M12 32C12.5523 32 13 31.5523 13 31C13 30.4477 12.5523 30 12 30C11.4477 30 11 30.4477 11 31C11 31.5523 11.4477 32 12 32Z" fill="black"/>
<path d="M17 27C17 27.5523 16.5523 28 16 28C15.4477 28 15 27.5523 15 27C15 26.4477 15.4477 26 16 26C16.5523 26 17 26.4477 17 27Z" fill="black"/>
<path d="M20 29C20.5523 29 21 28.5523 21 28C21 27.4477 20.5523 27 20 27C19.4477 27 19 27.4477 19 28C19 28.5523 19.4477 29 20 29Z" fill="black"/>
<path d="M36 18C36 18.5523 36.4477 19 37 19C37.5523 19 38 18.5523 38 18C38 17.4477 37.5523 17 37 17C36.4477 17 36 17.4477 36 18Z" fill="black"/>
<path d="M35 23C34.4477 23 34 22.5523 34 22C34 21.4477 34.4477 21 35 21C35.5523 21 36 21.4477 36 22C36 22.5523 35.5523 23 35 23Z" fill="black"/>
<path d="M36 26C36 26.5523 36.4477 27 37 27C37.5523 27 38 26.5523 38 26C38 25.4477 37.5523 25 37 25C36.4477 25 36 25.4477 36 26Z" fill="black"/>
<path d="M32 32C31.4477 32 31 31.5523 31 31C31 30.4477 31.4477 30 32 30C32.5523 30 33 30.4477 33 31C33 31.5523 32.5523 32 32 32Z" fill="black"/>
<path d="M35 31C35 31.5523 35.4477 32 36 32C36.5523 32 37 31.5523 37 31C37 30.4477 36.5523 30 36 30C35.4477 30 35 30.4477 35 31Z" fill="black"/>
<path d="M32 28C31.4477 28 31 27.5523 31 27C31 26.4477 31.4477 26 32 26C32.5523 26 33 26.4477 33 27C33 27.5523 32.5523 28 32 28Z" fill="black"/>
<path d="M27 28C27 28.5523 27.4477 29 28 29C28.5523 29 29 28.5523 29 28C29 27.4477 28.5523 27 28 27C27.4477 27 27 27.4477 27 28Z" fill="black"/>
<path d="M24 29C24.5523 29 25 28.5523 25 28C25 27.4477 24.5523 27 24 27C23.4477 27 23 27.4477 23 28C23 28.5523 23.4477 29 24 29Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.2263 14.725C33.8311 13.2191 34.6469 12.0825 35.6384 11.4564C36.6834 10.7965 37.8663 10.7501 38.9189 11.3558C39.9103 11.9262 40.672 13.0052 41.1835 14.3775C41.7012 15.7664 42 17.5493 42 19.6819V29.8691C42 30.7182 41.8359 32.6845 40.883 34.4771C39.8932 36.3389 38.045 38.0002 34.8462 38.0002C33.251 38.0002 32.0601 37.5494 31.0936 36.849C30.2289 36.2225 29.5679 35.4071 28.9943 34.6995L28.878 34.5561C28.2484 33.7817 27.6901 33.1275 26.9608 32.6456C26.2611 32.1833 25.354 31.8504 24 31.8504C22.646 31.8504 21.7389 32.1833 21.0392 32.6456C20.3099 33.1275 19.7516 33.7817 19.122 34.5561L19.0057 34.6995C18.4321 35.4071 17.7711 36.2225 16.9064 36.849C15.9399 37.5494 14.749 38.0002 13.1538 38.0002C9.95499 38.0002 8.10675 36.3389 7.11703 34.4771C6.16409 32.6845 6 30.7182 6 29.8691V19.6819C6 17.5493 6.29877 15.7664 6.81647 14.3775C7.32798 13.0052 8.08973 11.9262 9.08109 11.3558C10.1337 10.7501 11.3166 10.7965 12.3616 11.4564C13.3531 12.0825 14.1689 13.2191 14.7737 14.725C14.9275 15.1079 15.0778 15.5207 15.2352 15.9525C15.7537 17.3761 16.348 19.0077 17.3924 20.4676C18.6864 22.2764 20.6362 23.7381 24 23.7381C27.3638 23.7381 29.3136 22.2764 30.6076 20.4676C31.652 19.0077 32.2463 17.3761 32.7648 15.9525C32.9221 15.5209 33.0726 15.1077 33.2263 14.725ZM15.7658 21.6312C17.3804 23.8882 19.9018 25.7381 24 25.7381C28.0982 25.7381 30.6196 23.8882 32.2342 21.6312C33.4573 19.9216 34.1819 17.9229 34.704 16.4826C34.8425 16.1007 34.9667 15.758 35.0822 15.4704C35.6015 14.1775 36.2035 13.465 36.7063 13.1475C37.1556 12.8637 37.5437 12.8719 37.9215 13.0893C38.3605 13.3419 38.8887 13.9471 39.3095 15.076C39.7241 16.1883 40 17.7236 40 19.6819V29.8691C40 30.5481 39.8564 32.1474 39.117 33.5383C38.4144 34.86 37.1857 36.0002 34.8462 36.0002C33.6721 36.0002 32.8919 35.6823 32.2671 35.2295C31.6229 34.7628 31.116 34.1389 30.498 33.3783L30.4298 33.2944C29.8094 32.5314 29.0792 31.6482 28.0633 30.977C27.0178 30.2862 25.7229 29.8504 24 29.8504C22.2771 29.8504 20.9822 30.2862 19.9367 30.977C18.9208 31.6482 18.1906 32.5314 17.5702 33.2944L17.502 33.3783C16.884 34.1389 16.3771 34.7628 15.7329 35.2295C15.1081 35.6823 14.3279 36.0002 13.1538 36.0002C10.8143 36.0002 9.58562 34.86 8.88301 33.5383C8.14363 32.1474 8 30.5481 8 29.8691V19.6819C8 17.7236 8.27592 16.1883 8.69052 15.076C9.11132 13.9471 9.63947 13.3419 10.0785 13.0893C10.4563 12.8719 10.8444 12.8637 11.2937 13.1475C11.7965 13.465 12.3985 14.1775 12.9178 15.4704C13.0332 15.7579 13.1574 16.1004 13.2958 16.4821C13.818 17.9224 14.5427 19.9216 15.7658 21.6312Z" fill="black"/>
</svg>
''',
      colorFilter:
          color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
      width: width,
      height: height,
    );