input
InputElement
input(
Create an input element
Implementation
InputElement input({
String? type,
String? value,
String? placeholder,
void Function(SyntheticEvent)? onChange,
void Function(SyntheticEvent)? onInput,
void Function(SyntheticFocusEvent)? onFocus,
void Function(SyntheticFocusEvent)? onBlur,
Map<String, dynamic>? props,
Map<String, dynamic>? style,
String? className,
}) {
final p = _buildProps(props: props, style: style, className: className);
if (type != null) p['type'] = type;
if (value != null) p['value'] = value;
if (placeholder != null) p['placeholder'] = placeholder;
if (onChange != null) {
void handler(JSObject e) => onChange(SyntheticEvent.fromJs(e));
p['onChange'] = handler;
}
if (onInput != null) {
void handler(JSObject e) => onInput(SyntheticEvent.fromJs(e));
p['onInput'] = handler;
}
if (onFocus != null) {
void handler(JSObject e) => onFocus(SyntheticFocusEvent.fromJs(e));
p['onFocus'] = handler;
}
if (onBlur != null) {
void handler(JSObject e) => onBlur(SyntheticFocusEvent.fromJs(e));
p['onBlur'] = handler;
}
return InputElement.fromJS(createElement('input'.toJS, createProps(p)));
}