toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'type': type,
if (number != null) 'number': number,
if (string != null) 'string': string,
if (date != null) 'date': date,
if (array != null) 'array': array!.map((e) => e.toJson()).toList(),
};
}