uiTextField method
- bool autocorrect = true,
- bool enableSuggestions = true,
- TextEditingController? controller,
- String? initialValue,
- bool enabled = true,
- bool readOnly = false,
- bool obscureText = false,
- String obscuringCharacter = '•',
- TextInputAction? textInputAction,
- TextInputType? keyboardType,
- void onChanged()?,
- void onEditingComplete()?,
- void onFieldSubmitted()?,
- void onSaved()?,
- String? validator()?,
- List<
TextInputFormatter> ? inputFormatters, - String? errorText,
- String? helperText,
- String? hintText,
- String? labelText,
- Widget? leadingWidget,
- Widget? trailingWidget,
- CInputDecorationTheme? style,
- Key? key,
Provides for a generalized widget to allow for the collection of data and providing feedback to a user. It exposes the most common text field options to allow for building custom text fields (i.e. spin controls, number only, etc.).
Implementation
Widget uiTextField({
bool autocorrect = true,
bool enableSuggestions = true,
TextEditingController? controller,
String? initialValue,
bool enabled = true,
bool readOnly = false,
bool obscureText = false,
String obscuringCharacter = '•',
TextInputAction? textInputAction,
TextInputType? keyboardType,
void Function(String)? onChanged,
void Function()? onEditingComplete,
void Function(String)? onFieldSubmitted,
void Function(String?)? onSaved,
String? Function(String?)? validator,
List<TextInputFormatter>? inputFormatters,
String? errorText,
String? helperText,
String? hintText,
String? labelText,
Widget? leadingWidget,
Widget? trailingWidget,
CInputDecorationTheme? style,
Key? key,
}) {
return TextFormField(
// Setup the items that control how the widget will behave.
autocorrect: autocorrect,
controller: controller,
enabled: enabled,
enableSuggestions: enableSuggestions,
readOnly: readOnly,
initialValue: initialValue,
inputFormatters: inputFormatters,
keyboardType: keyboardType,
obscureText: obscureText,
obscuringCharacter: obscuringCharacter,
onChanged: onChanged,
onEditingComplete: onEditingComplete,
onFieldSubmitted: onFieldSubmitted,
onSaved: onSaved,
smartDashesType: SmartDashesType.disabled,
smartQuotesType: SmartQuotesType.disabled,
textInputAction: textInputAction,
validator: validator,
// Style items for overall input field along with setting labels.
decoration: InputDecoration(
prefixIconColor: style?.prefixIconColor,
prefixStyle: style?.prefixStyle,
prefix: leadingWidget,
suffix: trailingWidget,
suffixIconColor: style?.suffixIconColor,
suffixStyle: style?.suffixStyle,
labelText: labelText,
labelStyle: style?.labelStyle,
floatingLabelAlignment: style?.floatingLabelAlignment,
floatingLabelBehavior: style?.floatingLabelBehavior,
floatingLabelStyle: style?.floatingLabelStyle,
helperText: helperText,
helperStyle: style?.helperStyle,
helperMaxLines: style?.helperMaxLines,
hintText: hintText,
hintStyle: style?.hintStyle,
hintMaxLines: style?.hintMaxLines,
hintTextDirection: style?.hintTextDirection,
hintFadeDuration: style?.hintFadeDuration,
alignLabelWithHint: style?.alignLabelWithHint,
errorText: errorText,
errorStyle: style?.errorStyle,
errorMaxLines: style?.errorMaxLines,
errorBorder: style?.errorBorder,
focusedErrorBorder: style?.focusedErrorBorder,
focusedBorder: style?.focusedBorder,
fillColor: style?.fillColor,
filled: style?.filled,
),
style: style?.inputStyle,
textCapitalization: style?.textCapitalization ?? TextCapitalization.none,
textDirection: style?.textDirection,
textAlign: style?.textAlign ?? TextAlign.start,
textAlignVertical: style?.textAlignVertical,
maxLines: style?.maxLines,
maxLength: style?.maxLength,
minLines: style?.minLines,
expands: style?.expands ?? false,
scrollPadding: style?.scrollPadding ?? const EdgeInsets.all(20.0),
clipBehavior: style?.clipBehavior ?? Clip.hardEdge,
);
}