toJson method
Convert to JSON representation.
Implementation
@override
Map<String, dynamic> toJson() => {
'type': 'Command',
'head': head,
'args': args.map((a) => a.toJson()).toList(),
'criteria': criteria?.map((c) => c.toJson()).toList(),
'block': block?.toJson(),
if (trailingComment != null) 'trailingComment': trailingComment,
};