copyWith method

AutoCompleteTheme copyWith({
  1. ValueGetter<BoxConstraints?>? popoverConstraints,
  2. ValueGetter<PopoverConstraint?>? popoverWidthConstraint,
  3. ValueGetter<AlignmentDirectional?>? popoverAnchorAlignment,
  4. ValueGetter<AlignmentDirectional?>? popoverAlignment,
  5. ValueGetter<AutoCompleteMode?>? mode,
})

Creates a copy of this theme with specified properties overridden.

Each parameter function is called only if provided, allowing selective overrides while preserving existing values for unspecified properties.

Implementation

AutoCompleteTheme copyWith({
  ValueGetter<BoxConstraints?>? popoverConstraints,
  ValueGetter<PopoverConstraint?>? popoverWidthConstraint,
  ValueGetter<AlignmentDirectional?>? popoverAnchorAlignment,
  ValueGetter<AlignmentDirectional?>? popoverAlignment,
  ValueGetter<AutoCompleteMode?>? mode,
}) {
  return AutoCompleteTheme(
    popoverConstraints: popoverConstraints == null
        ? this.popoverConstraints
        : popoverConstraints(),
    popoverWidthConstraint: popoverWidthConstraint == null
        ? this.popoverWidthConstraint
        : popoverWidthConstraint(),
    popoverAnchorAlignment: popoverAnchorAlignment == null
        ? this.popoverAnchorAlignment
        : popoverAnchorAlignment(),
    popoverAlignment:
        popoverAlignment == null ? this.popoverAlignment : popoverAlignment(),
    mode: mode == null ? this.mode : mode(),
  );
}