toJson method
Implementation
@override
Map<String, dynamic> toJson() {
return {
'type': type.value,
if (_button != null || _thumbnail != null)
'accessory': _button?.toJson() ?? _thumbnail?.toJson(),
'components': builder.build(),
};
}