textButton method
Text button, can be colored
builder.textButton(
label: "Buy a coffee",
payload: {
"command": "buy"
},
color: Color.SECONDARY
);
Implementation
KeyboardBuilder textButton(
{required String label,
Color color = Color.SECONDARY,
_Button payload = const {}}) {
if (label.length > 40) {
throw RangeError('Maximum length of label 40 characters');
}
return _addButton({
'color': _colors[color.index],
'action': {
'label': label,
'payload': _serializePayload(payload),
'type': 'text'
}
});
}