DefaultTextField constructor
const
DefaultTextField({
- Key? key,
- dynamic onChanged()?,
- String? hintText,
- FocusNode? focusValue,
- TextEditingController? mainController,
- bool enabled = true,
- bool isSecureText = false,
- bool isRightAccessoryIcon = false,
- bool isShowCountryCodePrefixIcon = false,
- bool isShowPrefixIcon = true,
- String imageAssetPath = "",
- double leftPadding = 20,
- double rightPadding = 20,
- bool expand = false,
- int maxLines = 1,
- dynamic onSubmitted()?,
- TextInputType keyboardType = TextInputType.text,
- 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,
});