copyWith method Null safety

CupertinoTabBar copyWith(
  1. {Key? key,
  2. List<BottomNavigationBarItem>? items,
  3. Color? backgroundColor,
  4. Color? activeColor,
  5. Color? inactiveColor,
  6. double? iconSize,
  7. double? height,
  8. Border? border,
  9. int? currentIndex,
  10. ValueChanged<int>? onTap}
)

Create a clone of the current CupertinoTabBar but with provided parameters overridden.

Implementation

CupertinoTabBar copyWith({
  Key? key,
  List<BottomNavigationBarItem>? items,
  Color? backgroundColor,
  Color? activeColor,
  Color? inactiveColor,
  double? iconSize,
  double? height,
  Border? border,
  int? currentIndex,
  ValueChanged<int>? onTap,
}) {
  return CupertinoTabBar(
    key: key ?? this.key,
    items: items ?? this.items,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    activeColor: activeColor ?? this.activeColor,
    inactiveColor: inactiveColor ?? this.inactiveColor,
    iconSize: iconSize ?? this.iconSize,
    height: height ?? this.height,
    border: border ?? this.border,
    currentIndex: currentIndex ?? this.currentIndex,
    onTap: onTap ?? this.onTap,
  );
}