copyWith method

  1. @useResult
FTextFieldStyle copyWith({
  1. Brightness? keyboardAppearance,
  2. Color? cursorColor,
  3. Color? fillColor,
  4. bool? filled,
  5. EdgeInsetsGeometry? contentPadding,
  6. EdgeInsetsGeometry? clearButtonPadding,
  7. EdgeInsets? scrollPadding,
  8. FButtonStyle clearButtonStyle(
    1. FButtonStyle
    )?,
  9. FWidgetStateMap<TextStyle>? contentTextStyle,
  10. FWidgetStateMap<TextStyle>? hintTextStyle,
  11. FWidgetStateMap<TextStyle>? counterTextStyle,
  12. FWidgetStateMap<InputBorder>? border,
  13. EdgeInsetsGeometry? labelPadding,
  14. EdgeInsetsGeometry? descriptionPadding,
  15. EdgeInsetsGeometry? errorPadding,
  16. EdgeInsetsGeometry? childPadding,
  17. FWidgetStateMap<TextStyle>? labelTextStyle,
  18. FWidgetStateMap<TextStyle>? descriptionTextStyle,
  19. TextStyle? errorTextStyle,
})

Returns a copy of this FTextFieldStyle with the given properties replaced.

Where possible, it is strongly recommended to use the CLI to generate a style and directly modify the style.

keyboardAppearance

The appearance of the keyboard. Defaults to FColors.brightness.

This setting is only honored on iOS devices.

cursorColor

The color of the cursor. Defaults to CupertinoColors.activeBlue.

The cursor indicates the current location of text insertion point in the field.

fillColor

The base fill color of the decoration's container colors.

filled

If true the decoration's container is filled with fillColor. Defaults to false.

contentPadding

The padding surrounding this text field's content.

Defaults to const EdgeInsets.symmetric(horizontal: 14, vertical: 14).

clearButtonPadding

The padding surrounding the clear button. Defaults to EdgeInsetsDirectional.only(end: 2).

scrollPadding

Configures padding to edges surrounding a Scrollable when this text field scrolls into view.

Defaults to EdgeInsets.all(20).

When this widget receives focus and is not completely visible (for example scrolled partially off the screen or overlapped by the keyboard) then it will attempt to make itself visible by scrolling a surrounding Scrollable, if one is present. This value controls how far from the edges of a Scrollable the TextField will be positioned after the scroll.

clearButtonStyle

The clear button's style when FTextField.clearable is true.

contentTextStyle

The content's TextStyle.

The supported states are:

hintTextStyle

The hint's TextStyle.

The supported states are:

counterTextStyle

The counter's TextStyle.

The supported states are:

border

The border.

The supported states are:

labelPadding

The label's padding.

descriptionPadding

The description's padding.

errorPadding

The error's padding.

childPadding

The child's padding.

labelTextStyle

The label's text style.

Supported states:

descriptionTextStyle

The description's text style.

Supported states:

errorTextStyle

The error's text style.

Implementation

@useResult
FTextFieldStyle copyWith({
  Brightness? keyboardAppearance,
  Color? cursorColor,
  Color? fillColor,
  bool? filled,
  EdgeInsetsGeometry? contentPadding,
  EdgeInsetsGeometry? clearButtonPadding,
  EdgeInsets? scrollPadding,
  FButtonStyle Function(FButtonStyle)? clearButtonStyle,
  FWidgetStateMap<TextStyle>? contentTextStyle,
  FWidgetStateMap<TextStyle>? hintTextStyle,
  FWidgetStateMap<TextStyle>? counterTextStyle,
  FWidgetStateMap<InputBorder>? border,
  EdgeInsetsGeometry? labelPadding,
  EdgeInsetsGeometry? descriptionPadding,
  EdgeInsetsGeometry? errorPadding,
  EdgeInsetsGeometry? childPadding,
  FWidgetStateMap<TextStyle>? labelTextStyle,
  FWidgetStateMap<TextStyle>? descriptionTextStyle,
  TextStyle? errorTextStyle,
}) => FTextFieldStyle(
  keyboardAppearance: keyboardAppearance ?? this.keyboardAppearance,
  cursorColor: cursorColor ?? this.cursorColor,
  fillColor: fillColor ?? this.fillColor,
  filled: filled ?? this.filled,
  contentPadding: contentPadding ?? this.contentPadding,
  clearButtonPadding: clearButtonPadding ?? this.clearButtonPadding,
  scrollPadding: scrollPadding ?? this.scrollPadding,
  clearButtonStyle: clearButtonStyle != null ? clearButtonStyle(this.clearButtonStyle) : this.clearButtonStyle,
  contentTextStyle: contentTextStyle ?? this.contentTextStyle,
  hintTextStyle: hintTextStyle ?? this.hintTextStyle,
  counterTextStyle: counterTextStyle ?? this.counterTextStyle,
  border: border ?? this.border,
  labelPadding: labelPadding ?? this.labelPadding,
  descriptionPadding: descriptionPadding ?? this.descriptionPadding,
  errorPadding: errorPadding ?? this.errorPadding,
  childPadding: childPadding ?? this.childPadding,
  labelTextStyle: labelTextStyle ?? this.labelTextStyle,
  descriptionTextStyle: descriptionTextStyle ?? this.descriptionTextStyle,
  errorTextStyle: errorTextStyle ?? this.errorTextStyle,
);