toJson method
Implementation
Map<String, Object?> toJson() => {
'chars': chars,
if (fitsText case var text?) 'fits': {'text': text, 'chars': chars},
if (clipsChars case var clips?)
'clips': {'text': ?clipsText, 'chars': clips},
if (screen case var screen?) 'screen': screen.toJson(),
if (clipped case var clipped?) 'clipped': clipped.toJson(),
'measuredOn': ?measuredOn,
};