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="M17.72 29.8941C17.8635 29.8523 17.9526 29.8079 18 29.7767V25H20V29.7767C20.0474 29.8079 20.1365 29.8523 20.28 29.8941C20.4502 29.9438 20.6339 29.9718 20.7843 29.9864C20.8253 29.9904 20.8621 29.9932 20.8934 29.9952C20.8819 28.3854 20.9674 25.6491 23.2479 25.6491C26.5375 25.6491 28.8872 37.1315 27.4774 38.3032C26.0675 39.4748 23.2479 38.7718 21.838 37.3658C20.7627 36.2934 20.7912 33.8666 20.8572 31.9962C20.7885 31.9931 20.6974 31.9874 20.5907 31.977C20.3661 31.9552 20.0498 31.9103 19.72 31.8141C19.5042 31.7512 19.2486 31.6567 19 31.5094C18.7514 31.6567 18.4958 31.7512 18.28 31.8141C17.9502 31.9103 17.6339 31.9552 17.4093 31.977C17.2945 31.9882 17.1978 31.9939 17.1276 31.9968C17.0923 31.9983 17.0634 31.9991 17.0419 31.9995L17.0377 31.9995C17.1036 33.8696 17.1314 36.2941 16.0567 37.3658C14.6469 38.7718 11.8272 39.4749 10.4174 38.3032C9.00755 37.1315 11.3573 25.6491 14.6469 25.6491C16.9296 25.6491 17.013 28.3907 17.0014 29.9999L17.003 29.9999C17.0108 29.9997 17.0249 29.9994 17.0443 29.9985C17.0835 29.9969 17.143 29.9935 17.2157 29.9864C17.3661 29.9718 17.5498 29.9438 17.72 29.8941ZM23.1664 27.7117L23.1724 27.6995C23.3206 27.8318 23.5329 28.0815 23.7826 28.4951C24.3119 29.3719 24.8102 30.6499 25.1953 32.0627C25.577 33.4628 25.8135 34.87 25.8774 35.9498C25.9002 36.3346 25.8988 36.6428 25.8835 36.8739C25.6958 36.9048 25.4196 36.9116 25.0385 36.8377C24.3175 36.6979 23.6368 36.3351 23.2503 35.9497C23.2503 35.9497 23.2233 35.923 23.1801 35.8388C23.1364 35.7534 23.0858 35.6269 23.0372 35.4487C22.9376 35.0829 22.8745 34.6051 22.847 34.0283C22.8199 33.4591 22.8299 32.8593 22.8494 32.2601C22.8544 32.1079 22.8602 31.9498 22.8661 31.7905C22.882 31.3641 22.8982 30.928 22.8982 30.5701C22.8982 30.4374 22.8972 30.3038 22.8962 30.1701C22.8907 29.438 22.8852 28.7012 23.0437 28.0686C23.0842 27.9071 23.1278 27.7908 23.1664 27.7117ZM14.7284 27.7117L14.7224 27.6995C14.5742 27.8318 14.3618 28.0815 14.1122 28.4951C13.5829 29.3719 13.0846 30.6499 12.6995 32.0627C12.3178 33.4628 12.0813 34.87 12.0174 35.9498C11.9946 36.3346 11.996 36.6428 12.0112 36.8739C12.199 36.9048 12.4752 36.9116 12.8563 36.8377C13.5773 36.6979 14.258 36.3351 14.6445 35.9497C14.6445 35.9497 14.6715 35.923 14.7146 35.8388C14.7584 35.7534 14.809 35.6269 14.8576 35.4487C14.9572 35.0829 15.0203 34.6051 15.0478 34.0283C15.0749 33.4591 15.0649 32.8593 15.0454 32.2601C15.0404 32.1078 15.0346 31.9497 15.0286 31.7903C15.0128 31.364 14.9966 30.928 14.9966 30.5701C14.9966 30.4375 14.9976 30.3041 14.9986 30.1705C15.0041 29.4384 15.0096 28.7012 14.8511 28.0687C14.8106 27.9071 14.767 27.7908 14.7284 27.7117Z" fill="black"/>
<path d="M32 14C32 14.5523 31.5523 15 31 15C30.4477 15 30 14.5523 30 14C30 13.4477 30.4477 13 31 13C31.5523 13 32 13.4477 32 14Z" fill="black"/>
<path d="M34 17C34 17.5523 33.5523 18 33 18C32.4477 18 32 17.5523 32 17C32 16.4477 32.4477 16 33 16C33.5523 16 34 16.4477 34 17Z" fill="black"/>
<path d="M36 20C36 20.5523 35.5523 21 35 21C34.4477 21 34 20.5523 34 20C34 19.4477 34.4477 19 35 19C35.5523 19 36 19.4477 36 20Z" fill="black"/>
<path d="M42 19C42 19.5523 41.5523 20 41 20C40.4477 20 40 19.5523 40 19C40 18.4477 40.4477 18 41 18C41.5523 18 42 18.4477 42 19Z" fill="black"/>
<path d="M42 14C42 14.5523 41.5523 15 41 15C40.4477 15 40 14.5523 40 14C40 13.4477 40.4477 13 41 13C41.5523 13 42 13.4477 42 14Z" fill="black"/>
<path d="M42 10C42 10.5523 41.5523 11 41 11C40.4477 11 40 10.5523 40 10C40 9.44772 40.4477 9 41 9C41.5523 9 42 9.44772 42 10Z" fill="black"/>
<path d="M38 12C38 12.5523 37.5523 13 37 13C36.4477 13 36 12.5523 36 12C36 11.4477 36.4477 11 37 11C37.5523 11 38 11.4477 38 12Z" fill="black"/>
<path d="M38 16C38 16.5523 37.5523 17 37 17C36.4477 17 36 16.5523 36 16C36 15.4477 36.4477 15 37 15C37.5523 15 38 15.4477 38 16Z" fill="black"/>
<path d="M30 19C30 19.5523 29.5523 20 29 20C28.4477 20 28 19.5523 28 19C28 18.4477 28.4477 18 29 18C29.5523 18 30 18.4477 30 19Z" fill="black"/>
<path d="M23 17C23 17.5523 22.5523 18 22 18C21.4477 18 21 17.5523 21 17C21 16.4477 21.4477 16 22 16C22.5523 16 23 16.4477 23 17Z" fill="black"/>
<path d="M20 16C20 16.5523 19.5523 17 19 17C18.4477 17 18 16.5523 18 16C18 15.4477 18.4477 15 19 15C19.5523 15 20 15.4477 20 16Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.7229 24.0194C21.6184 24.0194 20.7229 23.124 20.7229 22.0194V21.0728C20.7229 19.9683 21.6184 19.0728 22.7229 19.0728H23.7825C24.0012 19.0728 24.1914 18.9897 24.3161 18.8722C24.4372 18.7579 24.4846 18.626 24.4853 18.5123L24.4853 18.5049L24.4874 18.2679C24.4885 18.1239 24.4899 17.9311 24.4908 17.7341C24.4917 17.5361 24.4921 17.3384 24.4915 17.1831C24.4911 17.1049 24.4906 17.0434 24.4898 17.0007C24.4896 16.9911 24.4894 16.9835 24.4893 16.9775C24.4637 16.5821 24.5522 16.1616 24.7834 15.7828C24.9627 15.489 25.1846 15.2905 25.374 15.1605C25.1221 14.5701 24.8583 13.9508 24.608 13.313C24.5175 13.0822 24.4706 12.8365 24.4699 12.5885L24.4696 12.5735C24.4693 12.5566 24.4686 12.5268 24.467 12.4865C24.4636 12.4051 24.4568 12.2844 24.4428 12.1409C24.4132 11.837 24.3587 11.5064 24.2741 11.2434C23.9826 10.3368 23.3869 9.52217 22.552 8.9311C21.7171 8.34009 20.6927 8.00894 19.6273 8C18.6008 7.99934 17.6089 8.30279 16.7901 8.85521C15.9711 9.40779 15.3727 10.1765 15.0582 11.0406C14.7444 11.9031 14.7229 12.8327 14.9955 13.7057C15.2685 14.5802 15.8287 15.3709 16.6187 15.9556C17.1282 16.3328 17.4287 16.9292 17.4287 17.5631V22.0194C17.4287 23.124 16.5333 24.0194 15.4287 24.0194H12.5981C11.3671 24.0163 10.2025 24.4712 9.34936 25.2577C8.50602 26.0351 8.03545 27.0702 8 28.1366V40H30.9963V29.0534C30.9963 29.0307 30.9966 29.008 30.9974 28.9854C31.0186 28.3639 30.9097 27.7425 30.6746 27.1558C30.4393 26.5688 30.0807 26.0248 29.6139 25.558C29.147 25.091 28.5812 24.7109 27.9466 24.4447C27.3173 24.1807 26.6359 24.0354 25.9418 24.0194H22.7229ZM26.7214 22.0726C27.4097 22.1557 28.0831 22.3331 28.7201 22.6003C29.5896 22.965 30.3741 23.4896 31.0282 24.1439C31.6824 24.7981 32.1931 25.5689 32.531 26.4116C32.8688 27.2544 33.0269 28.1523 32.9963 29.0534V42H6V28.1068C6.04412 26.4752 6.75973 24.9248 7.99374 23.7872C9.22776 22.6496 10.8822 22.0151 12.6032 22.0194H15.4287V17.5631C14.3087 16.734 13.4897 15.5938 13.0864 14.3018C12.683 13.0097 12.7153 11.6305 13.1788 10.3567C13.6423 9.08298 14.5138 7.97837 15.6716 7.19726C16.8293 6.41615 18.2155 5.99757 19.6363 6.00001C21.1046 6.01077 22.5309 6.46577 23.7076 7.29874C24.8842 8.13171 25.7497 9.29916 26.1781 10.6311C26.4699 11.5383 26.4699 12.5825 26.4699 12.5825C26.7155 13.2087 26.9766 13.8203 27.2376 14.4318L27.6062 15.3204C27.7438 15.561 27.8372 15.822 27.8826 16.0922C27.8926 16.2717 27.8323 16.4483 27.7132 16.5881C27.6593 16.6513 27.5952 16.705 27.5238 16.7475C27.4373 16.7989 27.3401 16.8339 27.2377 16.8495C27.2251 16.8495 27.1856 16.8432 27.1309 16.8345C27.0768 16.8259 27.0079 16.8149 26.9354 16.8053C26.7218 16.7769 26.4764 16.7602 26.4852 16.8495C26.5 17 26.4852 18.5243 26.4852 18.5243C26.482 19.0653 26.2985 19.5877 25.9667 20.0194L25.9631 20.0241C25.8804 20.1311 25.7887 20.2325 25.6882 20.3273C25.1818 20.8048 24.4967 21.0728 23.7826 21.0728H22.7229V22.0194H25.9631C26.2172 22.0244 26.4703 22.0422 26.7214 22.0726ZM24.4888 16.9609C24.4888 16.9609 24.4888 16.9618 24.4889 16.9642L24.4888 16.9609Z" fill="black"/>
</svg>
''',
      colorFilter:
          color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
      width: width,
      height: height,
    );