call method

  1. @override
Object? call(
  1. Interpreter interpreter,
  2. List<Object?> arguments,
  3. Map<Symbol, Object?> namedArguments
)
override

Implementation

@override
Object? call(Interpreter interpreter, List<Object?> arguments,
    Map<Symbol, Object?> namedArguments) {
  if (arguments.isEmpty) {
    throw "arguments required in ChartBarWithDataBuilder";
  }
  var data = arguments.first;
  bool animated = false;
  var animatedParsed = namedArguments[const Symbol('animated')];
  if (animatedParsed != null) {
    animated = animatedParsed as bool;
  }
  double height = parseDouble(namedArguments[const Symbol('height')]) ?? 200;
  bool vertical = true;
  var verticalParsed = namedArguments[const Symbol('vertical')];
  if (verticalParsed != null) {
    vertical = verticalParsed as bool;
  }
  bool showBarLabel = false;
  var showBarLabelParsed = namedArguments[const Symbol('showBarLabel')];
  if (showBarLabelParsed != null) {
    showBarLabel = showBarLabelParsed as bool;
  }
  int titleFontSize = 14;
  var titleFontSizeParsed = namedArguments[const Symbol('titleFontSize')];
  if (titleFontSizeParsed != null) {
    titleFontSize = titleFontSizeParsed as int;
  }
  double maskFontSize =
      parseDouble(namedArguments[const Symbol('maskFontSize')]) ?? 18;
  bool showLegend = true;
  var showLegendParsed = namedArguments[const Symbol('showLegend')];
  if (showLegendParsed != null) {
    showLegend = showLegendParsed as bool;
  }
  var showChartTitle = true;
  var showChartTitleParsed = namedArguments[const Symbol('showChartTitle')];
  if (showChartTitleParsed != null) {
    showChartTitle = showChartTitleParsed as bool;
  }
  bool hidePrimaryAxis = false;
  var hidePrimaryAxisParsed = namedArguments[const Symbol('hidePrimaryAxis')];
  if (hidePrimaryAxisParsed != null) {
    hidePrimaryAxis = hidePrimaryAxisParsed as bool;
  }
  bool hideSecondaryAxis = false;
  var hideSecondaryAxisParsed =
      namedArguments[const Symbol('hideSecondaryAxis')];
  if (hideSecondaryAxisParsed != null) {
    hideSecondaryAxis = hideSecondaryAxisParsed as bool;
  }
  bool hideDomainAxis = false;
  var hideDomainAxisParsed = namedArguments[const Symbol('hideDomainAxis')];
  if (hideDomainAxisParsed != null) {
    hideDomainAxis = hideDomainAxisParsed as bool;
  }

  Widget? loadingWidget;
  var loadingWidgetParsed = namedArguments[const Symbol('loadingWidget')];
  if (loadingWidgetParsed != null) {
    loadingWidget = loadingWidgetParsed as Widget;
  }
  bool showAxisLine = false;
  var showAxisLineParsed = namedArguments[const Symbol('showAxisLine')];
  if (showAxisLineParsed != null) {
    showAxisLine = showAxisLineParsed as bool;
  }
  String groupType = 'grouped';
  var groupTypeParsed = namedArguments[const Symbol('groupType')];
  if (groupTypeParsed != null) {
    groupType = groupTypeParsed as String;
  }
  return ChartBar.withChartData(data as List<dynamic>,
      animate: animated,
      height: height,
      vertical: vertical,
      titleFontSize: titleFontSize,
      maskFontSize: maskFontSize,
      showLegend: showLegend,
      groupType: groupType,
      showBarLabel: showBarLabel,
      showChartTitle: showChartTitle,
      loadingWidget: loadingWidget,
      hidePrimaryAxis: hidePrimaryAxis,
      showAxisLine: showAxisLine,
      hideSecondaryAxis: hideSecondaryAxis,
      hideDomainAxis: hideDomainAxis);
}