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 in a number of different situations. For example:

Here it is called whenever the user interaction is performed and it removes the old widget and updates a chart with a new widget in SfFunnelChart.

Implementation

@override
Widget build(BuildContext context) {
  _stateProperties.renderingDetails.oldDeviceOrientation =
      _stateProperties.renderingDetails.oldDeviceOrientation == null
          ? MediaQuery.of(context).orientation
          : _stateProperties.renderingDetails.deviceOrientation;
  _stateProperties.renderingDetails.deviceOrientation =
      MediaQuery.of(context).orientation;
  _stateProperties.isTooltipOrientationChanged = false;
  return RepaintBoundary(
      child: ChartContainer(
          child: GestureDetector(
              child: Container(
                  decoration: BoxDecoration(
                      color: widget.backgroundColor,
                      image: widget.backgroundImage != null
                          ? DecorationImage(
                              image: widget.backgroundImage!,
                              fit: BoxFit.fill)
                          : null,
                      border: Border.all(
                          color: widget.borderColor,
                          width: widget.borderWidth)),
                  child: Column(
                    children: <Widget>[
                      renderChartTitle(_stateProperties),
                      _renderChartElements()
                    ],
                  )))));
}