FTextField constructor
const
FTextField({
- Key? key,
- String? label,
- bool isMandatory = false,
- TextEditingController? controller,
- FColorI fSelectColor = FColor.lightBlack,
- TextInputType textInputType = TextInputType.text,
- List<
TextInputFormatter> inputFormatters = const [], - bool enabled = true,
- bool showAlwaysEnabled = false,
- TextCapitalization textCapitalization = TextCapitalization.none,
- void onChanged()?,
- IconData? prefixIcon,
- TextAlign textAlign = TextAlign.end,
- String? hintText,
- FocusNode? focusNode,
- void onEditingComplete()?,
- VoidCallback? onTap,
- void onSubmitted()?,
- FIconType? suffixIcon,
- int? maxLines,
- int? minLines,
- double borderRadius = 5,
- bool obscureText = false,
- Iterable<
String> ? autofillHints, - FTextStyle? labelStyle,
- FTextStyle? mandatoryStyle,
- FTextStyle? mandatoryStyleDisabled,
- FTextStyle? textStyle,
- FTextStyle? hintStyle,
- FTextStyle? disabledStyle,
- FTextStyle? errorStyle,
- AutovalidateMode? autovalidateMode,
- FColorI fillColor = FColor.noColor,
- FColorI fFillDisabledColor = FColor.lightPaleGray,
- FColorI fDisabledBorderColor = FColor.lightMidGray,
- FColorI fErrorBorderColor = FColor.lightError,
- FColorI fErrorTextColor = FColor.lightError,
- FColorI fErrorIconColor = FColor.lightError,
- FColorI fInstructionsColorText = FColor.lightBlack,
- String? instructions,
- bool readOnly = false,
- FIconType fIconError = FIconType.solid,
- InputDecoration? inputDecoration,
- bool isDense = false,
- FormFieldValidator<
String> ? validator, - String? initialValue,
- bool isDropdown = false,
- double height = 48,
- double focusIndex = 0,
Implementation
const FTextField({
Key? key,
this.label,
this.isMandatory = false,
this.controller,
this.fSelectColor = FColor.lightBlack,
this.textInputType = TextInputType.text,
this.inputFormatters = const [],
this.enabled = true,
this.showAlwaysEnabled = false,
this.textCapitalization = TextCapitalization.none,
this.onChanged,
this.prefixIcon,
this.textAlign = TextAlign.end,
this.hintText,
this.focusNode,
this.onEditingComplete,
this.onTap,
this.onSubmitted,
this.suffixIcon,
this.maxLines,
this.minLines,
this.borderRadius = 5,
this.obscureText = false,
this.autofillHints,
this.labelStyle,
this.mandatoryStyle,
this.mandatoryStyleDisabled,
this.textStyle,
this.hintStyle,
this.disabledStyle,
this.errorStyle,
this.autovalidateMode,
this.fillColor = FColor.noColor,
this.fFillDisabledColor = FColor.lightPaleGray,
this.fDisabledBorderColor = FColor.lightMidGray,
this.fErrorBorderColor = FColor.lightError,
this.fErrorTextColor = FColor.lightError,
this.fErrorIconColor = FColor.lightError,
this.fInstructionsColorText = FColor.lightBlack,
this.instructions,
this.readOnly = false,
this.fIconError = FIconType.solid,
this.inputDecoration,
this.isDense = false,
this.validator,
this.initialValue,
this.isDropdown = false,
this.height = 48,
this.focusIndex = 0,
}) : assert(
(controller == null && initialValue == null) ||
(controller != null && initialValue == null) ||
(controller == null && initialValue != null),
'Either controller or initialValue can be null. Both of them can be null. But both of them can not be non null'),
assert(label != null || hintText != null),
super(key: key);