InputField.fromFieldInfo constructor

InputField.fromFieldInfo(
  1. FieldInfo info, {
  2. double? labelFieldSpace,
  3. Color? borderColor,
  4. double? elevation,
  5. EdgeInsets? contentPadding,
  6. InputDecoration? inputDecoration,
  7. InputDecorationBuilder? inputDecorationBuilder,
  8. Color? fillColor,
  9. TextStyle? textStyle,
  10. TextStyle? allTextStyle,
  11. TextStyle? labelStyle,
  12. TextStyle? hintStyle,
  13. TextStyle? innerLabelStyle,
  14. bool? labelIsBold,
  15. BorderRadius? borderRadius,
  16. FocusNode? focusNode,
  17. TextDirection? textDirection,
  18. TextAlign? textAlign,
  19. Key? key,
})

This constructor takes a field info object for the main properties (used mostly for forms)

Implementation

InputField.fromFieldInfo(
  FieldInfo info, {
  this.labelFieldSpace,
  this.borderColor,
  this.elevation,
  this.contentPadding,
  this.inputDecoration,
  this.inputDecorationBuilder,
  this.fillColor,
  this.textStyle,
  this.allTextStyle,
  this.labelStyle,
  this.hintStyle,
  this.innerLabelStyle,
  this.labelIsBold,
  this.borderRadius,
  this.focusNode,
  this.textDirection,
  this.textAlign,
  super.key,
})  : controller = info.controller,
      hintText = info.hint,
      prefixIcon = info.prefixIcon,
      suffixIcon = info.suffixIcon,
      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 ?? '*') : '')}',
      onTap = info.onTap,
      onTapOutside = info.onTapOutside,
      readOnly = info.readOnly,
      isObscure = info.isObscure,
      minLines = info.minLines,
      maxLines = info.maxLines,
      onChanged = info.onChanged,
      inputFormatters = info.inputFormatters,
      validator = info.validator;