call method
Implementation
@override
Object? call(Interpreter interpreter, List<Object?> arguments,
Map<Symbol, Object?> namedArguments) {
if (arguments.isEmpty) {
throw "arguments required in ChartPieWithDataBuilder";
}
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;
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;
}
Widget? loadingWidget;
var loadingWidgetParsed = namedArguments[const Symbol('loadingWidget')];
if (loadingWidgetParsed != null) {
loadingWidget = loadingWidgetParsed as Widget;
}
int arcWidth = 40;
var arcWidthParsed = namedArguments[const Symbol('arcWidth')];
if (arcWidthParsed != null) {
arcWidth = arcWidthParsed as int;
}
return ChartPie.withChartData(
data as List<dynamic>,
height: height,
animate: animated,
titleFontSize: titleFontSize,
maskFontSize: maskFontSize,
showLegend: showLegend,
arcWidth: arcWidth,
showChartTitle: showChartTitle,
loadingWidget: loadingWidget,
);
}