ModularCustomizableDropdown.displayOnCallback constructor

ModularCustomizableDropdown.displayOnCallback({
  1. required dynamic onValueSelect(
    1. DropdownValue selectedValue
    ),
  2. required List<DropdownValue> 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,
  8. @visibleForTesting Key? listviewKey,
  9. @visibleForTesting Key? overlayEntryKey,
  10. @visibleForTesting Key? offStageWidgetKey,
  11. @visibleForTesting List<Key>? rowKeys,
})

Expose a toggle callback in the target builder method.

Implementation

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