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="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.9697 6.96967C17.2626 6.67678 17.7374 6.67678 18.0303 6.96967L17.5 7.5C18.0303 6.96967 18.0306 6.96989 18.0308 6.97012L18.0313 6.9706L18.0323 6.97168L18.0349 6.97426L18.0416 6.98113L18.0613 7.00165C18.0771 7.01833 18.0982 7.04101 18.1237 7.06959C18.1747 7.1267 18.2439 7.20756 18.325 7.31121C18.487 7.51816 18.6983 7.8181 18.9084 8.20336C19.3286 8.97364 19.75 10.0966 19.75 11.5C19.75 12.9034 19.3286 14.0264 18.9084 14.7966C18.6983 15.1819 18.487 15.4818 18.325 15.6888C18.2439 15.7924 18.1747 15.8733 18.1237 15.9304C18.0982 15.959 18.0771 15.9817 18.0613 15.9984L18.0416 16.0189L18.0349 16.0257L18.0323 16.0283L18.0313 16.0294L18.0308 16.0299C18.0306 16.0301 18.0303 16.0303 17.5207 15.5207L18.0303 16.0303C17.7374 16.3232 17.2626 16.3232 16.9697 16.0303C16.6776 15.7383 16.6768 15.2654 16.9671 14.9723C16.9679 14.9714 16.9688 14.9705 16.9697 14.9697L17.5 15.5C16.9697 14.9697 16.9695 14.9699 16.9693 14.9701L16.9689 14.9705L16.9682 14.9711L16.9673 14.9721L16.9724 14.9667C16.9786 14.9602 16.9897 14.9482 17.0052 14.9309C17.0362 14.8962 17.0842 14.8404 17.1437 14.7643C17.263 14.6119 17.4267 14.3806 17.5916 14.0784C17.9214 13.4736 18.25 12.5966 18.25 11.5C18.25 10.4034 17.9214 9.52636 17.5916 8.92164C17.4267 8.6194 17.263 8.38809 17.1437 8.23567C17.0842 8.15963 17.0362 8.10377 17.0052 8.06908C16.9897 8.05176 16.9786 8.03978 16.9724 8.03326L16.9671 8.02774C16.6768 7.73464 16.6776 7.2617 16.9697 6.96967Z" fill="currentColor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.9697 3.96967C20.2626 3.67678 20.7374 3.67678 21.0303 3.96967L20.5 4.5C21.0303 3.96967 21.0306 3.96991 21.0308 3.97017L21.0314 3.97072L21.0327 3.972L21.0359 3.97527L21.045 3.98462C21.0523 3.9921 21.0619 4.00207 21.0736 4.01451C21.0971 4.03939 21.1292 4.0742 21.1688 4.11882C21.2478 4.20802 21.3566 4.33662 21.4851 4.50365C21.7419 4.83749 22.0786 5.32653 22.4137 5.96319C23.0845 7.23773 23.75 9.10689 23.75 11.5C23.75 13.8931 23.0845 15.7623 22.4137 17.0368C22.0786 17.6735 21.7419 18.1625 21.4851 18.4963C21.3566 18.6634 21.2478 18.792 21.1688 18.8812C21.1292 18.9258 21.0971 18.9606 21.0736 18.9855C21.0619 18.9979 21.0523 19.0079 21.045 19.0154L21.0359 19.0247L21.0327 19.028L21.0314 19.0293L21.0308 19.0298C21.0306 19.0301 21.0303 19.0303 20.5 18.5L21.0303 19.0303C20.7374 19.3232 20.2626 19.3232 19.9697 19.0303C19.6771 18.7378 19.6768 18.2636 19.9687 17.9706C19.9688 17.9706 19.9689 17.9705 19.969 17.9704L19.9689 17.9705L19.9687 17.9706L19.9683 17.9711L19.9678 17.9716C19.9679 17.9714 19.9684 17.9709 19.9693 17.97L19.9825 17.9562C19.9957 17.9422 20.0173 17.9189 20.0461 17.8864C20.1038 17.8213 20.1903 17.7194 20.2962 17.5818C20.5081 17.3062 20.7964 16.889 21.0863 16.3382C21.6655 15.2377 22.25 13.6069 22.25 11.5C22.25 9.39311 21.6655 7.76227 21.0863 6.66181C20.7964 6.11097 20.5081 5.69376 20.2962 5.41822C20.1903 5.28057 20.1038 5.17869 20.0461 5.1136C20.0173 5.08107 19.9957 5.05777 19.9825 5.04384L19.9693 5.03C19.9683 5.02899 19.9678 5.02845 19.9677 5.02839L19.9683 5.02891L19.9689 5.02951L19.9692 5.02989C19.6768 4.73696 19.6769 4.26242 19.9697 3.96967ZM19.9677 5.02838C19.9677 5.02838 19.9677 5.02838 19.9677 5.02839L19.9677 5.02838Z" fill="currentColor"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.0367 3.3964C13.2002 2.62923 14.75 3.46373 14.75 4.85741V19.1431C14.75 20.5368 13.2002 21.3713 12.0367 20.6041L6.03762 16.6487C5.99677 16.6218 5.94892 16.6074 5.9 16.6074H3C1.48122 16.6074 0.25 15.3762 0.25 13.8574V10.1431C0.25 8.62434 1.48122 7.39313 3 7.39313H5.9C5.94892 7.39313 5.99677 7.37877 6.03762 7.35184L12.0367 3.3964Z" fill="currentColor"/>
</svg>
''',
colorFilter:
color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
width: width,
height: height,
);