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;
int desiredCount = 4;
var desiredCountParsed = namedArguments[const Symbol('desiredCount')];
if (desiredCountParsed != null) {
desiredCount = desiredCountParsed as int;
}
bool useSides = true;
var useSidesParsed = namedArguments[const Symbol('useSides')];
if (useSidesParsed != null) {
useSides = useSidesParsed as bool;
}
void Function(dynamic)? onSelectionChanged;
var onSelectionChangedParsed =
namedArguments[const Symbol('onSelectionChange')];
if (onSelectionChangedParsed != null) {
onSelectionChanged = (s) {
(onSelectionChangedParsed as LoxFunction).call(interpreter, [s], {});
};
}
double? height = parseDouble(namedArguments[const Symbol('height')]);
Color axisColor = Colors.grey;
var axisColorParsed = namedArguments[const Symbol('axisColor')];
if (axisColorParsed != null) {
axisColor = axisColorParsed as Color;
}
Color outlinedColor = Colors.grey;
var outlinedColorParsed = namedArguments[const Symbol('outlinedColor')];
if (outlinedColorParsed != null) {
outlinedColor = outlinedColorParsed as Color;
}
TextStyle tickStyle = const TextStyle(color: Colors.grey, fontSize: 12);
var tickStyleParsed = namedArguments[const Symbol('tickStyle')];
if (tickStyleParsed != null) {
tickStyle = tickStyleParsed as TextStyle;
}
TextStyle labelStyle =
const TextStyle(color: Color(0xff707f89), fontSize: 14);
var labelStyleParsed = namedArguments[const Symbol('labelStyle')];
if (labelStyleParsed != null) {
labelStyle = labelStyleParsed as TextStyle;
}
bool showLegend = true;
var showLegendParsed = namedArguments[const Symbol('showLegend')];
if (showLegendParsed != null) {
showLegend = showLegendParsed as bool;
}
return ChartRadar.withChartData(
data as List<dynamic>,
height: height,
desiredCount: desiredCount,
useSides: useSides,
axisColor: axisColor,
showLegend: showLegend,
outlineColor: outlinedColor,
tickStyle: tickStyle,
labelStyle: labelStyle,
onSelectionChanged: onSelectionChanged,
);
}