call method
Implementation
@override
Object? call(Interpreter interpreter, List<Object?> arguments,
Map<Symbol, Object?> namedArguments) {
var value = namedArguments[const Symbol('value')];
if (value == null) {
throw "value required in Radio";
}
var groupValue = namedArguments[const Symbol('groupValue')];
if (groupValue == null) {
throw "groupValue required in Radio";
}
var onChanged = namedArguments[const Symbol('onChanged')];
if (onChanged == null) {
throw "onChanged required in Radio";
}
bool toggleable = false;
var toggleableParse = namedArguments[const Symbol('toggleable')];
if (toggleableParse != null) {
toggleable = toggleableParse as bool;
}
Color? activeColor;
var activeColorParse = namedArguments[const Symbol('activeColor')];
if (activeColorParse != null) {
activeColor = activeColorParse as Color;
}
Color? focusColor;
var focusColorParse = namedArguments[const Symbol('focusColor')];
if (focusColorParse != null) {
focusColor = focusColorParse as Color;
}
bool autofocus = false;
var autofocusParse = namedArguments[const Symbol('autofocus')];
if (autofocusParse != null) {
autofocus = autofocusParse as bool;
}
double? splashRadius =
parseDouble(namedArguments[const Symbol('splashRadius')]);
return Radio(
value: value,
toggleable: toggleable,
focusColor: focusColor,
activeColor: activeColor,
groupValue: groupValue,
splashRadius: splashRadius,
autofocus: autofocus,
onChanged: (value) {
(onChanged as LoxFunction).call(interpreter, [value], {});
},
);
}