copyWith method

HexConfig copyWith({
  1. int? bytesPerLine,
  2. int? groupSize,
  3. bool? showOffset,
  4. bool? showAscii,
  5. bool? enableSelection,
  6. bool? enableCopy,
  7. ByteColorScheme? colorScheme,
})

Creates a copy of this configuration with the given fields replaced.

Example:

final newConfig = config.copyWith(
  bytesPerLine: 32,
  groupSize: 16,
);

Implementation

HexConfig copyWith({
  int? bytesPerLine,
  int? groupSize,
  bool? showOffset,
  bool? showAscii,
  bool? enableSelection,
  bool? enableCopy,
  ByteColorScheme? colorScheme,
}) {
  return HexConfig(
    bytesPerLine: bytesPerLine ?? this.bytesPerLine,
    groupSize: groupSize ?? this.groupSize,
    showOffset: showOffset ?? this.showOffset,
    showAscii: showAscii ?? this.showAscii,
    enableSelection: enableSelection ?? this.enableSelection,
    enableCopy: enableCopy ?? this.enableCopy,
    colorScheme: colorScheme ?? this.colorScheme,
  );
}