InputField.fromFieldInfo constructor
InputField.fromFieldInfo(
- FieldInfo info, {
- double? labelFieldSpace,
- Color? borderColor,
- double? elevation,
- EdgeInsets? contentPadding,
- InputDecoration? inputDecoration,
- InputDecorationBuilder? inputDecorationBuilder,
- Color? fillColor,
- TextStyle? textStyle,
- TextStyle? allTextStyle,
- TextStyle? labelStyle,
- TextStyle? hintStyle,
- TextStyle? innerLabelStyle,
- bool? labelIsBold,
- BorderRadius? borderRadius,
- FocusNode? focusNode,
- TextDirection? textDirection,
This constructor takes a field info object for the main properties (used mostly for forms)
Implementation
factory InputField.fromFieldInfo(
FieldInfo info, {
double? labelFieldSpace,
Color? borderColor,
double? elevation,
EdgeInsets? contentPadding,
InputDecoration? inputDecoration,
InputDecorationBuilder? inputDecorationBuilder,
Color? fillColor,
TextStyle? textStyle,
TextStyle? allTextStyle,
TextStyle? labelStyle,
TextStyle? hintStyle,
TextStyle? innerLabelStyle,
bool? labelIsBold,
BorderRadius? borderRadius,
FocusNode? focusNode,
TextDirection? textDirection,
}) =>
InputField(
controller: info.controller,
hintText: info.hint,
contentPadding: contentPadding,
prefixIcon: info.prefixIcon,
suffixIcon: info.suffixIcon,
inputDecoration: inputDecoration,
fillColor: fillColor,
labelText: info.label == null ? null : '${info.label}${(info.required ?? false) ? (info.requiredString ?? ' (Required)') : ''}',
inputType: info.inputType,
isMultiline: info.multiLine,
innerLabelText: info.innerLabel == null
? null
: '${info.innerLabel}${((info.label == null && (info.required ?? false)) ? (info.requiredString ?? '*') : '')}',
labelFieldSpace: labelFieldSpace ?? 10,
borderColor: borderColor,
elevation: elevation,
onTap: info.onTap,
readOnly: info.readOnly,
isObscure: info.isObscure,
minLines: info.minLines,
maxLines: info.maxLines,
hintStyle: hintStyle,
textStyle: textStyle,
labelStyle: labelStyle,
allTextStyle: allTextStyle,
innerLabelStyle: innerLabelStyle,
labelIsBold: labelIsBold,
onChanged: info.onChanged,
inputDecorationBuilder: inputDecorationBuilder,
borderRadius: borderRadius,
focusNode: focusNode,
textDirection: textDirection,
inputFormatters: info.inputFormatters,
validator: info.validator,
);