uiTextField method

Widget uiTextField({
  1. bool autocorrect = true,
  2. bool enableSuggestions = true,
  3. TextEditingController? controller,
  4. String? initialValue,
  5. bool enabled = true,
  6. bool readOnly = false,
  7. bool obscureText = false,
  8. String obscuringCharacter = '•',
  9. TextInputAction? textInputAction,
  10. TextInputType? keyboardType,
  11. void onChanged(
    1. String
    )?,
  12. void onEditingComplete()?,
  13. void onFieldSubmitted(
    1. String
    )?,
  14. void onSaved(
    1. String?
    )?,
  15. String? validator(
    1. String?
    )?,
  16. List<TextInputFormatter>? inputFormatters,
  17. String? errorText,
  18. String? helperText,
  19. String? hintText,
  20. String? labelText,
  21. Widget? leadingWidget,
  22. Widget? trailingWidget,
  23. CInputDecorationTheme? style,
  24. 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,
  );
}