dataSource property

List<T>? get dataSource
inherited

Implementation

List<T>? get dataSource => _dataSource;
  1. @override
set dataSource (List<T>? value)
override

Implementation

@override
set dataSource(List<T>? value) {
  if ((value == null || value.isEmpty) && !listEquals(_dataSource, value)) {
    _dataCount = 0;
    segments.clear();
    markNeedsUpdate();
  }

  if (_dataCount != value?.length || !listEquals(_dataSource, value)) {
    _dataSource = value;
    canUpdateOrCreateSegments = true;
    parent?.isLegendToggled = false;
    if (xAxis != null &&
        yAxis != null &&
        parent != null &&
        parent!.enableAxisAnimation) {
      populateDataSource();
      xAxis!.calculateVisibleRangeAndInvokeAnimation();
      yAxis!.calculateVisibleRangeAndInvokeAnimation();
      markNeedsLayout();
    } else {
      markNeedsUpdate();
    }
    animationType = AnimationType.realtime;
  }
}