copyWith method

HexGridConfig copyWith({
  1. int? columns,
  2. int? rows,
  3. double? hexSize,
  4. HexOrientation? orientation,
  5. bool? showGridLines,
  6. Color? gridLineColor,
  7. double? gridLineWidth,
  8. Color? fillColor,
  9. double? spacing,
  10. bool? enableInteraction,
})

复制并修改配置

Implementation

HexGridConfig copyWith({
  int? columns,
  int? rows,
  double? hexSize,
  HexOrientation? orientation,
  bool? showGridLines,
  Color? gridLineColor,
  double? gridLineWidth,
  Color? fillColor,
  double? spacing,
  bool? enableInteraction,
}) {
  return HexGridConfig(
    columns: columns ?? this.columns,
    rows: rows ?? this.rows,
    hexSize: hexSize ?? this.hexSize,
    orientation: orientation ?? this.orientation,
    showGridLines: showGridLines ?? this.showGridLines,
    gridLineColor: gridLineColor ?? this.gridLineColor,
    gridLineWidth: gridLineWidth ?? this.gridLineWidth,
    fillColor: fillColor ?? this.fillColor,
    spacing: spacing ?? this.spacing,
    enableInteraction: enableInteraction ?? this.enableInteraction,
  );
}