HexConfig constructor

const HexConfig({
  1. int bytesPerLine = 16,
  2. int groupSize = 8,
  3. bool showOffset = true,
  4. bool showAscii = true,
  5. bool enableSelection = true,
  6. bool enableCopy = true,
  7. ByteColorScheme colorScheme = const ByteColorScheme.standard(),
})

Creates a hex viewer configuration.

All parameters are optional with sensible defaults suitable for most use cases.

Throws AssertionError if:

  • bytesPerLine is not positive
  • groupSize is negative
  • groupSize exceeds bytesPerLine

Implementation

const HexConfig({
  this.bytesPerLine = 16,
  this.groupSize = 8,
  this.showOffset = true,
  this.showAscii = true,
  this.enableSelection = true,
  this.enableCopy = true,
  this.colorScheme = const ByteColorScheme.standard(),
}) : assert(bytesPerLine > 0, 'bytesPerLine must be positive'),
     assert(groupSize >= 0, 'groupSize must be non-negative'),
     assert(
       groupSize == 0 || groupSize <= bytesPerLine,
       'groupSize cannot exceed bytesPerLine',
     );