textButton method

KeyboardBuilder textButton({
  1. required String label,
  2. Color color = Color.SECONDARY,
  3. _Button payload = const {},
})

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'
    }
  });
}