ModularCustomizableDropdown.displayOnCallback constructor

ModularCustomizableDropdown.displayOnCallback({
  1. required dynamic onValueSelect(
    1. String selectedValue
    ),
  2. required List<String> allDropdownValues,
  3. required Widget targetBuilder(
    1. void toggleDropdown(
      1. bool toggleState
      )
    ),
  4. required bool collapseOnSelect,
  5. bool barrierDismissible = true,
  6. DropdownStyle style = const DropdownStyle(invertYAxisAlignmentWhenOverflow: true),
  7. Key? key,
})

Expose a toggle callback in the target builder method.

Implementation

factory ModularCustomizableDropdown.displayOnCallback({
  required Function(String selectedValue) onValueSelect,
  required List<String> allDropdownValues,
  required Widget Function(void Function(bool toggleState) toggleDropdown)
      targetBuilder,
  required bool collapseOnSelect,
  bool barrierDismissible = true,
  DropdownStyle style =
      const DropdownStyle(invertYAxisAlignmentWhenOverflow: true),
  Key? key,
}) {
  return ModularCustomizableDropdown(
    reactMode: ReactMode.callbackReact,
    onValueSelect: onValueSelect,
    allDropdownValues: allDropdownValues,
    collapseOnSelect: collapseOnSelect,
    callbackReactParams: CallbackReactParams(targetBuilder: targetBuilder),
    dropdownStyle: style,
    barrierDismissible: barrierDismissible,
  );
}