defaultInputDecotation function

InputDecoration defaultInputDecotation({
  1. String? hintText,
  2. Text? label,
  3. String? labeltext,
  4. String? prefixText,
  5. String? suffixText,
  6. String? errorText,
  7. Widget? prefixIcon,
  8. Widget? suffixIcon,
  9. String counterText = '',
  10. Color? fillColor,
  11. bool enabled = true,
  12. TextStyle? hintStyle,
  13. TextStyle? floatingLabelStyle,
  14. FloatingLabelBehavior? floatingLabelBehavior,
  15. FloatingLabelAlignment? floatingLabelAlignment,
  16. Icon? icon,
})

This is a default implementation of InputDecoration that can be used as a base for custom InputDecoration

It is used in FormFieldItem widget

You can change some properties of the InputDecoration by passing a lot of InputDecoration properties to the constructor, or you can create your own InputDecoration and pass it to the FormFieldItem constructor to single field, or to the AdvancedFormGenerator constructor to all fields.

Implementation

InputDecoration defaultInputDecotation(
    {String? hintText,
    Text? label,
    String? labeltext,
    String? prefixText,
    String? suffixText,
    String? errorText,
    Widget? prefixIcon,
    Widget? suffixIcon,
    String counterText = '',
    Color? fillColor,
    bool enabled = true,
    TextStyle? hintStyle,
    TextStyle? floatingLabelStyle,
    FloatingLabelBehavior? floatingLabelBehavior,
    FloatingLabelAlignment? floatingLabelAlignment,
    Icon? icon}) {
  return InputDecoration(
    hintText: hintText,
    errorText: errorText,
    prefixText: prefixText,
    suffixText: suffixText,
    counterText: counterText,
    label: label ?? FormFieldLabel(text: labeltext ?? ''),
    icon: icon,
    prefixIcon: prefixIcon,
    suffixIcon: suffixIcon,
    fillColor: fillColor ?? const Color(0xFFF2F3F5),
    enabled: enabled,
    floatingLabelAlignment: floatingLabelAlignment,
    floatingLabelBehavior: FloatingLabelBehavior.auto,
    floatingLabelStyle: floatingLabelStyle ??
        const TextStyle(
          color: Colors.black87,
          fontWeight: FontWeight.w600,
          fontSize: 18,
        ),
    hintStyle: hintStyle ??
        const TextStyle(
          color: Color(0xFF666666),
          fontSize: 14,
        ),
    border: const OutlineInputBorder(
      borderRadius: BorderRadius.all(Radius.circular(10.0)),
      borderSide: BorderSide(
        width: 0,
        style: BorderStyle.none,
      ),
    ),
    filled: true,
  );
}