call method
Implementation
@override
Object? call(Interpreter interpreter, List<Object?> arguments,
Map<Symbol, Object?> namedArguments) {
TextEditingController? controller;
var controllerParsed = namedArguments[const Symbol('controller')];
if (controllerParsed != null) {
controller = controllerParsed as TextEditingController;
}
Function(String)? onChanged;
var onChangedParsed = namedArguments[const Symbol('onChanged')];
if (onChangedParsed != null) {
onChanged = (String value) {
(onChangedParsed as LoxFunction).call(interpreter, [value], {});
};
}
Function(String)? onSubmitted;
var onSubmittedParsed = namedArguments[const Symbol('onChanged')];
if (onSubmittedParsed != null) {
onSubmitted = (String value) {
(onSubmitted as LoxFunction).call(interpreter, [value], {});
};
}
InputDecoration? decoration;
var decorationParsed = namedArguments[const Symbol('decoration')];
if (decorationParsed != null) {
decoration = decorationParsed as InputDecoration;
}
int maxLines = 1;
var maxLinesParsed = namedArguments[const Symbol('maxLines')];
if (maxLinesParsed != null) {
maxLines = maxLinesParsed as int;
}
int? minLines;
var minLinesParsed = namedArguments[const Symbol('minLines')];
if (minLinesParsed != null) {
minLines = minLinesParsed as int;
}
TextStyle? style;
var styleParsed = namedArguments[const Symbol('style')];
if (styleParsed != null) {
style = styleParsed as TextStyle;
}
TextInputType? keyboardType;
var keyboardTypeParsed = namedArguments[const Symbol('keyboardType')];
if (keyboardTypeParsed != null) {
keyboardType = keyboardTypeParsed as TextInputType;
}
TextAlign textAlign = TextAlign.start;
var textAlignParsed = namedArguments[const Symbol('textAlign')];
if (textAlignParsed != null) {
textAlign = textAlignParsed as TextAlign;
}
TextAlignVertical? textAlignVertical;
var textAlignVerticalParsed =
namedArguments[const Symbol('textAlignVertical')];
if (textAlignVerticalParsed != null) {
textAlignVertical = textAlignVerticalParsed as TextAlignVertical;
}
TextDirection? textDirection;
var textDirectionParsed = namedArguments[const Symbol('textDirection')];
if (textDirectionParsed != null) {
textDirection = textDirectionParsed as TextDirection;
}
TextInputAction? textInputAction;
var textInputActionParsed = namedArguments[const Symbol('textInputAction')];
if (textInputActionParsed != null) {
textInputAction = textInputActionParsed as TextInputAction;
}
TextCapitalization textCapitalization = TextCapitalization.none;
var textCapitalizationParsed =
namedArguments[const Symbol('textCapitalization')];
if (textCapitalizationParsed != null) {
textCapitalization = textCapitalizationParsed as TextCapitalization;
}
bool readOnly = false;
var readOnlyParsed = namedArguments[const Symbol('readOnly')];
if (readOnlyParsed != null) {
readOnly = readOnlyParsed as bool;
}
bool? showCursor;
var showCursorParsed = namedArguments[const Symbol('showCursor')];
if (showCursorParsed != null) {
showCursor = showCursorParsed as bool;
}
double? cursorHeight =
parseDouble(namedArguments[const Symbol('cursorHeight')]);
Radius? cursorRadius;
var cursorRadiusParsed = namedArguments[const Symbol('cursorRadius')];
if (cursorRadiusParsed != null) {
cursorRadius = cursorRadiusParsed as Radius;
}
Color? cursorColor;
var cursorColorParsed = namedArguments[const Symbol('cursorColor')];
if (cursorColorParsed != null) {
cursorColor = cursorColorParsed as Color;
}
bool? enabled;
var enabledParsed = namedArguments[const Symbol('enabled')];
if (enabledParsed != null) {
enabled = enabledParsed as bool;
}
bool autofocus = false;
var autofocusParsed = namedArguments[const Symbol('autofocus')];
if (autofocusParsed != null) {
autofocus = autofocusParsed as bool;
}
bool autocorrect = true;
var autocorrectParsed = namedArguments[const Symbol('autocorrect')];
if (autocorrectParsed != null) {
autocorrect = autocorrectParsed as bool;
}
bool obscureText = false;
var obscureTextParsed = namedArguments[const Symbol('obscureText')];
if (obscureTextParsed != null) {
obscureText = obscureTextParsed as bool;
}
String obscureCharacter = '•';
var obscureCharacterParsed =
namedArguments[const Symbol('obscureCharacter')];
if (obscureCharacterParsed != null) {
obscureCharacter = obscureCharacterParsed as String;
}
bool expands = false;
var expandsParsed = namedArguments[const Symbol('expands')];
if (expandsParsed != null) {
expands = expandsParsed as bool;
}
FocusNode? focusNode;
var focusNodeParsed = namedArguments[const Symbol('focusNode')];
if (focusNodeParsed != null) {
focusNode = focusNodeParsed as FocusNode;
}
int? maxLength;
var maxLengthParsed = namedArguments[const Symbol('maxLength')];
if (maxLengthParsed != null) {
maxLength = maxLengthParsed as int;
}
double cursorWidth =
parseDouble(namedArguments[const Symbol('cursorWidth')]) ?? 2.0;
return TextField(
enabled: enabled,
autocorrect: autocorrect,
focusNode: focusNode,
obscuringCharacter: obscureCharacter,
autofocus: autofocus,
obscureText: obscureText,
controller: controller,
decoration: decoration,
textAlign: textAlign,
expands: expands,
textInputAction: textInputAction,
keyboardType: keyboardType,
textAlignVertical: textAlignVertical,
textDirection: textDirection,
textCapitalization: textCapitalization,
onChanged: onChanged,
onSubmitted: onSubmitted,
readOnly: readOnly,
showCursor: showCursor,
maxLines: maxLines,
minLines: minLines,
maxLength: maxLength,
cursorWidth: cursorWidth,
cursorHeight: cursorHeight,
cursorRadius: cursorRadius,
cursorColor: cursorColor,
style: style,
);
}