copyWith method

  1. @override
TxExpandableTextThemeData copyWith({
  1. int? collapsedLines,
  2. TextStyle? toggleButtonTextStyle,
  3. Color? toggleButtonForegroundColor,
  4. TxTextOverflow? overflow,
})
override

创建此对象的副本,但将给定字段替换为新值。

Implementation

@override
TxExpandableTextThemeData copyWith({
  int? collapsedLines,
  TextStyle? toggleButtonTextStyle,
  Color? toggleButtonForegroundColor,
  TxTextOverflow? overflow,
}) {
  assert(collapsedLines == null || collapsedLines > 0);

  return TxExpandableTextThemeData(
    collapsedLines: collapsedLines ?? this.collapsedLines,
    toggleButtonTextStyle:
        toggleButtonTextStyle ?? this.toggleButtonTextStyle,
    toggleButtonForegroundColor:
        toggleButtonForegroundColor ?? this.toggleButtonForegroundColor,
    overflow: overflow ?? this.overflow,
  );
}