copyWith method Null safety

ExpansionTileThemeData copyWith(
  1. {Color? backgroundColor,
  2. Color? collapsedBackgroundColor,
  3. EdgeInsetsGeometry? tilePadding,
  4. AlignmentGeometry? expandedAlignment,
  5. EdgeInsetsGeometry? childrenPadding,
  6. Color? iconColor,
  7. Color? collapsedIconColor,
  8. Color? textColor,
  9. Color? collapsedTextColor}
)

Creates a copy of this object with the given fields replaced with the new values.

Implementation

ExpansionTileThemeData copyWith({
  Color? backgroundColor,
  Color? collapsedBackgroundColor,
  EdgeInsetsGeometry? tilePadding,
  AlignmentGeometry? expandedAlignment,
  EdgeInsetsGeometry? childrenPadding,
  Color? iconColor,
  Color? collapsedIconColor,
  Color? textColor,
  Color? collapsedTextColor,
}) {
  return ExpansionTileThemeData(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    collapsedBackgroundColor: collapsedBackgroundColor ?? this.collapsedBackgroundColor,
    tilePadding: tilePadding ?? this.tilePadding,
    expandedAlignment: expandedAlignment ?? this.expandedAlignment,
    childrenPadding: childrenPadding ?? this.childrenPadding,
    iconColor: iconColor ?? this.iconColor,
    collapsedIconColor: collapsedIconColor ?? this.collapsedIconColor,
    textColor: textColor ?? this.textColor,
    collapsedTextColor: collapsedTextColor ?? this.collapsedTextColor,
  );
}