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 d="M13.7427 24.3501C13.6236 25.0878 14.1241 25.7953 14.8071 26.2328C15.5209 26.6899 16.5385 26.9399 17.7369 26.763C18.9828 26.579 19.8683 25.8878 20.3903 25.0976C20.8947 24.3341 21.1023 23.4046 20.8706 22.7158C20.8161 22.554 20.6829 22.4312 20.5172 22.39C20.3515 22.3488 20.1763 22.3951 20.0524 22.5126C18.2566 24.2174 16.2286 24.6362 14.4103 23.9611C14.27 23.909 14.1138 23.9225 13.9845 23.9978C13.8553 24.0731 13.7665 24.2024 13.7427 24.3501Z" fill="black"/>
<path d="M33.8185 24.3501C33.9376 25.0878 33.4371 25.7953 32.7541 26.2328C32.0403 26.6899 31.0227 26.9399 29.8243 26.763C28.5784 26.579 27.6929 25.8878 27.1708 25.0976C26.6665 24.3341 26.4589 23.4046 26.6906 22.7158C26.745 22.554 26.8783 22.4312 27.044 22.39C27.2097 22.3488 27.3849 22.3951 27.5087 22.5126C29.3046 24.2174 31.3326 24.6362 33.1509 23.9611C33.2911 23.909 33.4474 23.9225 33.5766 23.9978C33.7059 24.0731 33.7947 24.2024 33.8185 24.3501Z" fill="black"/>
<path d="M31.0869 32.4337C30.9197 32.8276 30.6485 33.2071 30.3149 33.5543C29.0224 34.8995 26.7572 36 24.0132 36C21.2759 36 18.9764 34.9037 17.703 33.5454C17.3774 33.1982 17.1161 32.8245 16.9496 32.4429C16.7899 32.077 16.6786 31.6112 16.7985 31.1374C16.9353 30.5965 17.3335 30.2098 17.8505 30.0547C18.3043 29.9186 18.7916 29.9729 19.2387 30.0993C21.5916 30.7128 22.7389 30.9867 23.8768 30.9918C25.0121 30.997 26.1852 30.7337 28.5811 30.0977L28.5945 30.0941C29.0876 29.9705 29.5915 29.9259 30.0487 30.0445C30.5448 30.1732 30.9954 30.5062 31.1841 31.0603C31.3536 31.5581 31.2482 32.054 31.0869 32.4337Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 42C33.9411 42 42 33.9411 42 24C42 14.0589 33.9411 6 24 6C14.0589 6 6 14.0589 6 24C6 33.9411 14.0589 42 24 42ZM24 40C32.8366 40 40 32.8366 40 24C40 15.1634 32.8366 8 24 8C15.1634 8 8 15.1634 8 24C8 32.8366 15.1634 40 24 40Z" fill="black"/>
</svg>
''',
      colorFilter:
          color != null ? widgets.ColorFilter.mode(color!, widgets.BlendMode.srcIn) : null,
      width: width,
      height: height,
    );