DropDownInputField<TDestination> constructor

DropDownInputField<TDestination>({
  1. required List<DropdownMenuItem<TDestination>> items,
  2. required FieldModel<TDestination?, TDestination> field,
  3. required String labelText,
  4. int hintMaxLines = 1,
  5. String? hintText,
  6. bool autofocus = false,
  7. AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction,
  8. Key? key,
  9. Color? dropdownColor,
  10. Color? focusColor,
  11. Color? iconDisabledColor,
  12. Color? iconEnabledColor,
  13. String? helperText,
  14. int helperTextMaxLines = 1,
  15. int elevation = 8,
  16. FocusNode? focusNode,
  17. Widget? icon,
  18. double iconSize = 24.0,
  19. bool isDense = false,
  20. bool isExpanded = false,
  21. double? itemHeight,
  22. List<Widget> selectedItemBuilder(
    1. BuildContext context
    )?,
  23. TextStyle? style,
  24. void onTap()?,
  25. ValueChanged<TDestination?>? onChanged,
})

Implementation

DropDownInputField(
    {required List<DropdownMenuItem<TDestination>> items,
    required FieldModel<TDestination?, TDestination> field,
    required String labelText,
    int hintMaxLines = 1,
    String? hintText,
    bool autofocus = false,
    AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction,
    Key? key,
    Color? dropdownColor,
    Color? focusColor,
    Color? iconDisabledColor,
    Color? iconEnabledColor,
    String? helperText,
    int helperTextMaxLines = 1,
    int elevation = 8,
    FocusNode? focusNode,
    Widget? icon,
    double iconSize = 24.0,
    bool isDense = false,
    bool isExpanded = false,
    double? itemHeight,
    List<Widget> Function(BuildContext context)? selectedItemBuilder,
    TextStyle? style,
    void Function()? onTap,
    ValueChanged<TDestination?>? onChanged})
    : super(
          items: items,
          autofocus: autofocus,
          autovalidateMode: autovalidateMode,
          decoration: InputDecoration(
              labelText: labelText,
              hintMaxLines: hintMaxLines,
              hintText: hintText),
          dropdownColor: dropdownColor,
          disabledHint: helperText == null
              ? null
              : Text(
                  helperText,
                  maxLines: helperTextMaxLines,
                ),
          focusColor: focusColor,
          elevation: elevation,
          focusNode: focusNode,
          hint: helperText == null
              ? null
              : Text(
                  helperText,
                  maxLines: helperTextMaxLines,
                ),
          icon: icon,
          iconSize: iconSize,
          iconDisabledColor: iconDisabledColor,
          iconEnabledColor: iconEnabledColor,
          isDense: isDense,
          key: key,
          isExpanded: isExpanded,
          itemHeight: itemHeight,
          selectedItemBuilder: selectedItemBuilder,
          style: style,
          validator: field.validator,
          value: field.value,
          onChanged: (newValue) {
            field.post(value: newValue);

            if (onChanged != null) {
              onChanged(newValue);
            }
          },
          onSaved: field.setValue,
          onTap: onTap);