toJson method
Implementation
Map<String, Object?> toJson() => {
'image': image,
'scenario': scenario,
'step': step,
'stepIndex': stepIndex,
if (rect case var rect?) 'rect': rect.toJson(),
if (charStart != null) 'charStart': charStart,
if (charEnd != null) 'charEnd': charEnd,
if (locale != null) 'locale': locale,
if (device != null) 'device': device,
if (offstage) 'offstage': true,
if (overflowed) 'overflowed': true,
};