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 fill-rule="evenodd" clip-rule="evenodd" d="M12.548 30.7535C1.68377 26.1712 5.97137 10.7044 13.513 8.14889C16.6416 7.08877 20.0938 10.6058 20.0717 12.7895C20.0621 13.7337 19.5749 14.6543 19.0673 15.6135C18.4009 16.8727 17.6993 18.1984 17.9972 19.7311C18.5221 22.4312 19.11 26.987 17.5952 29.1496C16.0803 31.3122 14.5569 31.6008 12.548 30.7535ZM13.3252 28.9107C14.1079 29.2408 14.4924 29.2191 14.7033 29.1584C14.9198 29.096 15.3424 28.8797 15.9571 28.0022C16.3298 27.47 16.5836 26.3471 16.5612 24.6685C16.5403 23.0924 16.2862 21.4104 16.034 20.1127C15.6296 18.0324 16.4601 16.2946 17.0527 15.1483C17.1547 14.9508 17.2479 14.7749 17.3337 14.6127C17.5316 14.2389 17.6907 13.9383 17.8313 13.616C18.0187 13.1865 18.0701 12.932 18.0718 12.7693C18.0723 12.7174 18.0372 12.4529 17.7779 12.0175C17.5343 11.6087 17.1645 11.1732 16.7104 10.8032C15.7472 10.0183 14.8151 9.81937 14.1549 10.0431C11.3449 10.9953 8.70316 14.6619 8.10954 18.9645C7.54002 23.0924 8.95066 27.0656 13.3252 28.9107Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.3473 8.14889C41.889 10.7044 46.1766 26.1712 35.3124 30.7535C33.3034 31.6008 31.78 31.3122 30.2652 29.1496C28.7504 26.987 29.3383 22.4312 29.8631 19.7311C30.161 18.1984 29.4595 16.8727 28.793 15.6135C28.2854 14.6543 27.7982 13.7337 27.7887 12.7895C27.7666 10.6058 31.2188 7.08877 34.3473 8.14889ZM33.157 29.1584C33.368 29.2191 33.7525 29.2408 34.5351 28.9107C38.9097 27.0656 40.3203 23.0924 39.7508 18.9645C39.1572 14.6619 36.5155 10.9953 33.7055 10.0431C33.0452 9.81937 32.1131 10.0183 31.1499 10.8032C30.6958 11.1732 30.326 11.6087 30.0825 12.0175C29.8232 12.4529 29.788 12.7174 29.7886 12.7693C29.7902 12.932 29.8417 13.1865 30.0291 13.616C30.1697 13.9383 30.3288 14.2389 30.5266 14.6127C30.6125 14.7749 30.7056 14.9508 30.8077 15.1483C31.4002 16.2946 32.2307 18.0324 31.8264 20.1127C31.5741 21.4104 31.3201 23.0924 31.2991 24.6685C31.2768 26.3471 31.5306 27.47 31.9033 28.0022C32.518 28.8797 32.9406 29.096 33.157 29.1584Z" fill="black"/>
<path d="M28.6181 22.7799C28.6867 23.7775 28.6879 23.7774 28.6879 23.7774L28.6891 23.7773L28.6913 23.7772L28.6952 23.7769L28.7007 23.7764L28.7036 23.7761C28.7036 23.7761 28.6934 23.7773 28.6791 23.7796C28.6504 23.7842 28.6001 23.7938 28.5357 23.8121C28.4046 23.8492 28.2318 23.9173 28.0626 24.0378C27.7729 24.2441 27.3469 24.7023 27.3469 25.8585V40.3246C27.3469 40.3246 27.3469 40.3248 26.3469 40.3248C25.3469 40.3248 25.3469 40.3242 25.3469 40.3242V25.8585C25.3469 24.0922 26.0565 23.0111 26.9024 22.4087C27.301 22.1249 27.696 21.9712 27.9907 21.8878C28.1393 21.8457 28.2665 21.8203 28.3619 21.8049C28.4097 21.7972 28.4501 21.792 28.4816 21.7885C28.4974 21.7867 28.5111 21.7854 28.5224 21.7844L28.5377 21.7831L28.5441 21.7826L28.5469 21.7824L28.5482 21.7823C28.5482 21.7823 28.5495 21.7822 28.6181 22.7799Z" fill="black"/>
<path d="M19.2423 22.7799C19.1737 23.7775 19.1724 23.7774 19.1724 23.7774L19.1713 23.7773L19.169 23.7772L19.1652 23.7769L19.1596 23.7764L19.1565 23.7761C19.1565 23.7761 19.167 23.7773 19.1812 23.7796C19.21 23.7842 19.2603 23.7938 19.3246 23.8121C19.4557 23.8492 19.6285 23.9173 19.7978 24.0378C20.0875 24.2441 20.5135 24.7023 20.5135 25.8585V40.3246C20.5135 40.3246 20.5135 40.3248 21.5135 40.3248C22.5135 40.3248 22.5135 40.3242 22.5135 40.3242V25.8585C22.5135 24.0922 21.8038 23.0111 20.9579 22.4087C20.5594 22.1249 20.1644 21.9712 19.8696 21.8878C19.7211 21.8457 19.5939 21.8203 19.4985 21.8049C19.4506 21.7972 19.4103 21.792 19.3787 21.7885C19.3629 21.7867 19.3493 21.7854 19.3379 21.7844L19.3226 21.7831L19.3163 21.7826L19.3135 21.7824L19.3121 21.7823C19.3121 21.7823 19.3108 21.7822 19.2423 22.7799Z" fill="black"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);