toJson method
Implementation
@override
toJson() {
final block = <String, dynamic>{'type': 'section'};
if (text != null) block['text'] = {'type': 'mrkdwn', 'text': text};
if (fields != null) {
block['fields'] =
fields!.map((f) => {'type': 'mrkdwn', 'text': f}).toList();
}
if (accessory != null) block['accessory'] = accessory;
return block;
}