@@ -66,6 +66,7 @@ class DerivChart extends StatefulWidget {
6666 this .bottomChartTitleMargin,
6767 this .showDataFitButton,
6868 this .showScrollToLastTickButton,
69+ this .showLoadingAnimationForHistoricalData = true ,
6970 this .loadingAnimationColor,
7071 this .crosshairVariant = CrosshairVariant .smallScreen,
7172 this .interactiveLayerBehaviour,
@@ -174,6 +175,14 @@ class DerivChart extends StatefulWidget {
174175 /// Whether to show the scroll to last tick button or not.
175176 final bool ? showScrollToLastTickButton;
176177
178+ /// Whether to show the loading animation for historical data.
179+ ///
180+ /// When set to `false` , the loading animation will always be hidden.
181+ /// When set to `true` (default), the visibility will be determined by
182+ /// the [dataFitEnabled] property (hidden when dataFitEnabled is true,
183+ /// shown otherwise).
184+ final bool showLoadingAnimationForHistoricalData;
185+
177186 /// The color of the loading animation.
178187 final Color ? loadingAnimationColor;
179188
@@ -409,6 +418,8 @@ class _DerivChartState extends State<DerivChart> {
409418 bottomChartTitleMargin: widget.bottomChartTitleMargin,
410419 showDataFitButton: widget.showDataFitButton,
411420 showScrollToLastTickButton: widget.showScrollToLastTickButton,
421+ showLoadingAnimationForHistoricalData:
422+ widget.showLoadingAnimationForHistoricalData,
412423 loadingAnimationColor: widget.loadingAnimationColor,
413424 chartAxisConfig: widget.chartAxisConfig,
414425 crosshairVariant: widget.crosshairVariant,
0 commit comments