DefaultDropdown constructor

const DefaultDropdown({
  1. Key? key,
  2. required List<String> items,
  3. dynamic onChanged(
    1. String?
    )?,
  4. String? hintText,
  5. FocusNode? focusValue,
  6. TextEditingController? mainController,
  7. bool enabled = true,
  8. bool isShowPrefixIcon = true,
  9. String imageAssetPath = "",
  10. double leftPadding = 20,
  11. double rightPadding = 20,
  12. dynamic onSubmitted(
    1. String?
    )?,
  13. String? selectedValue,
})

Creates a customizable dropdown widget.

Parameters:

  • items: List of string options to display in dropdown (required)
  • onChanged: Callback triggered when selection changes
  • hintText: Placeholder text when no value is selected
  • focusValue: FocusNode for managing focus
  • enabled: Whether the dropdown is interactive (defaults to true)
  • isShowPrefixIcon: Whether to show the list icon prefix (defaults to true)
  • imageAssetPath: Custom image asset path (currently unused)
  • leftPadding: Left padding in pixels (defaults to 20)
  • rightPadding: Right padding in pixels (defaults to 20)
  • onSubmitted: Callback for submission events
  • selectedValue: Initially selected value or externally controlled value

Implementation

const DefaultDropdown({
  super.key,
  required this.items,
  this.onChanged,
  this.hintText,
  this.focusValue,
  this.mainController,
  this.enabled = true,
  this.isShowPrefixIcon = true,
  this.imageAssetPath = "",
  this.leftPadding = 20,
  this.rightPadding = 20,
  this.onSubmitted,
  this.selectedValue,
});