DefaultTextField constructor

const DefaultTextField({
  1. Key? key,
  2. dynamic onChanged(
    1. String
    )?,
  3. String? hintText,
  4. FocusNode? focusValue,
  5. TextEditingController? mainController,
  6. bool enabled = true,
  7. bool isSecureText = false,
  8. bool isRightAccessoryIcon = false,
  9. bool isShowCountryCodePrefixIcon = false,
  10. bool isShowPrefixIcon = true,
  11. String imageAssetPath = "",
  12. double leftPadding = 20,
  13. double rightPadding = 20,
  14. bool expand = false,
  15. int maxLines = 1,
  16. dynamic onSubmitted(
    1. String
    )?,
  17. TextInputType keyboardType = TextInputType.text,
  18. TextInputAction? inputAction,
})

Creates a default text field widget.

Parameters:

  • onChanged: Callback invoked when text changes.
  • hintText: Placeholder text displayed when field is empty.
  • focusValue: FocusNode for managing focus state.
  • mainController: TextEditingController for reading and controlling text.
  • enabled: Whether the field is enabled (defaults to true).
  • isSecureText: Whether to obscure text for password fields (defaults to false).
  • isRightAccessoryIcon: Whether to show a right chevron icon (defaults to false).
  • isShowCountryCodePrefixIcon: Whether to show country code prefix (defaults to false).
  • isShowPrefixIcon: Whether to show search icon prefix (defaults to true).
  • imageAssetPath: Path to custom prefix icon asset (currently unused).
  • leftPadding: Left padding around the text field (defaults to 20).
  • rightPadding: Right padding around the text field (defaults to 20).
  • expand: Whether the field should expand to fill available space (defaults to false).
  • maxLines: Maximum number of lines. Use -1 for unlimited (defaults to 1).
  • onSubmitted: Callback when user submits text (e.g., presses enter).
  • keyboardType: Type of keyboard to display (defaults to TextInputType.text).
  • inputAction: Keyboard action button type.

Implementation

const DefaultTextField({
  super.key,
  this.onChanged,
  this.hintText,
  this.focusValue,
  this.mainController,
  this.enabled = true,
  this.isSecureText = false,
  this.isRightAccessoryIcon = false,
  this.isShowCountryCodePrefixIcon = false,
  this.isShowPrefixIcon = true,
  this.imageAssetPath = "",
  this.leftPadding = 20,
  this.rightPadding = 20,
  this.expand = false,
  this.maxLines = 1,
  this.onSubmitted,
  this.keyboardType = TextInputType.text,
  this.inputAction,
});