copyWith method

  1. @override
ThemeExtension<AppBarThemeExtension> copyWith({
  1. Color? expandedForegroundColor,
  2. Color? collapsedForegroundColor,
})
override

Creates a copy of this theme extension with the given fields replaced by the non-null parameter values.

Implementation

@override
ThemeExtension<AppBarThemeExtension> copyWith({
  Color? expandedForegroundColor,
  Color? collapsedForegroundColor,
}) {
  return AppBarThemeExtension(
    expandedForegroundColor:
        expandedForegroundColor ?? this.expandedForegroundColor,
    collapsedForegroundColor:
        collapsedForegroundColor ?? this.collapsedForegroundColor,
  );
}