ModularCustomizableDropdown.displayOnFocus constructor

ModularCustomizableDropdown.displayOnFocus({
  1. required dynamic onValueSelect(
    1. String selectedValue
    ),
  2. required List<String> allDropdownValues,
  3. required Widget targetBuilder(
    1. FocusNode focusNode,
    2. TextEditingController textController
    ),
  4. required TextEditingController textController,
  5. required FocusNode focusNode,
  6. bool setTextToControllerOnSelect = true,
  7. bool collapseOnSelect = true,
  8. bool barrierDismissible = true,
  9. dynamic onDropdownVisible(
    1. bool
    )?,
  10. DropdownStyle style = const DropdownStyle(invertYAxisAlignmentWhenOverflow: true),
  11. Key? key,
})

Same as displayOnTap, but also triggers dropdown when the target is in focus

Implementation

factory ModularCustomizableDropdown.displayOnFocus({
  required Function(String selectedValue) onValueSelect,
  required List<String> allDropdownValues,
  required Widget Function(
          FocusNode focusNode, TextEditingController textController)
      targetBuilder,
  required TextEditingController textController,
  required FocusNode focusNode,
  bool setTextToControllerOnSelect = true,
  bool collapseOnSelect = true,
  bool barrierDismissible = true,
  Function(bool)? onDropdownVisible,
  DropdownStyle style =
      const DropdownStyle(invertYAxisAlignmentWhenOverflow: true),
  Key? key,
}) {
  return ModularCustomizableDropdown(
    reactMode: ReactMode.focusReact,
    onValueSelect: onValueSelect,
    allDropdownValues: allDropdownValues,
    collapseOnSelect: collapseOnSelect,
    focusReactParams: FocusReactParams(
        textController: textController,
        focusNode: focusNode,
        setTextToControllerOnSelect: setTextToControllerOnSelect,
        targetBuilder: targetBuilder),
    dropdownStyle: style,
    onDropdownVisibilityChange: onDropdownVisible,
    barrierDismissible: barrierDismissible,
  );
}