copyWith method Null safety

NavigationBarThemeData copyWith(
  1. {double? height,
  2. Color? backgroundColor,
  3. Color? surfaceTintColor,
  4. double? elevation,
  5. Color? indicatorColor,
  6. ShapeBorder? indicatorShape,
  7. MaterialStateProperty<TextStyle?>? labelTextStyle,
  8. MaterialStateProperty<IconThemeData?>? iconTheme,
  9. NavigationDestinationLabelBehavior? labelBehavior}
)

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

Implementation

NavigationBarThemeData copyWith({
  double? height,
  Color? backgroundColor,
  Color? surfaceTintColor,
  double? elevation,
  Color? indicatorColor,
  ShapeBorder? indicatorShape,
  MaterialStateProperty<TextStyle?>? labelTextStyle,
  MaterialStateProperty<IconThemeData?>? iconTheme,
  NavigationDestinationLabelBehavior? labelBehavior,
}) {
  return NavigationBarThemeData(
    height: height ?? this.height,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    surfaceTintColor: surfaceTintColor ?? this.surfaceTintColor,
    elevation: elevation ?? this.elevation,
    indicatorColor: indicatorColor ?? this.indicatorColor,
    indicatorShape: indicatorShape ?? this.indicatorShape,
    labelTextStyle: labelTextStyle ?? this.labelTextStyle,
    iconTheme: iconTheme ?? this.iconTheme,
    labelBehavior: labelBehavior ?? this.labelBehavior,
  );
}