DropdownDecoration constructor

const DropdownDecoration({
  1. TextStyle? labelTextStyle,
  2. TextStyle? hintTextStyle,
  3. TextStyle? errorMessageTextStyle,
  4. Color? outlineBorderColor,
  5. Color? borderColor,
  6. Color? errorBorderColor,
  7. double fieldHeight = 52,
  8. BorderRadius? borderRadius,
  9. Color? backgroundColor,
  10. bool reserveSpaceForValidationMessage = true,
  11. TextStyle? dropdownTextStyle = const TextStyle(fontSize: 14),
})

Creates a new DropdownDecoration instance with optional customization.

  • labelTextStyle: Style for the label text.
  • hintTextStyle: Style for the hint text.
  • dropdownTextStyle: Style for the text inside the dropdown items (default font size is 14).
  • errorMessageTextStyle: Style for error messages.
  • outlineBorderColor: Color for the outline border.
  • borderColor: Color for the normal state border.
  • errorBorderColor: Color for the error state border.
  • fieldHeight: Height of the dropdown field (default is 52).
  • borderRadius: Border radius for rounded corners.
  • backgroundColor: Color for the dropdown background.
  • reserveSpaceForValidationMessage: Indicator wether validation error container will be present even there is no error to display

Implementation

const DropdownDecoration({
  this.labelTextStyle,
  this.hintTextStyle,
  this.errorMessageTextStyle,
  this.outlineBorderColor,
  this.borderColor,
  this.errorBorderColor,
  this.fieldHeight = 52,
  this.borderRadius,
  this.backgroundColor,
  this.reserveSpaceForValidationMessage = true,
  this.dropdownTextStyle = const TextStyle(
    fontSize: 14,
  ),
});