copyWith method

HexCell copyWith({
  1. HexCoordinate? coordinate,
  2. Color? fillColor,
  3. Color? borderColor,
  4. double? borderWidth,
  5. bool? enabled,
  6. Map<String, dynamic>? data,
  7. bool? isSelected,
  8. bool? isOccupied,
})

复制并修改单元格属性

Implementation

HexCell copyWith({
  HexCoordinate? coordinate,
  Color? fillColor,
  Color? borderColor,
  double? borderWidth,
  bool? enabled,
  Map<String, dynamic>? data,
  bool? isSelected,
  bool? isOccupied,
}) {
  return HexCell(
    coordinate: coordinate ?? this.coordinate,
    fillColor: fillColor ?? this.fillColor,
    borderColor: borderColor ?? this.borderColor,
    borderWidth: borderWidth ?? this.borderWidth,
    enabled: enabled ?? this.enabled,
    data: data ?? this.data,
    isSelected: isSelected ?? this.isSelected,
    isOccupied: isOccupied ?? this.isOccupied,
  );
}