urlButton method

KeyboardBuilder urlButton({
  1. required String label,
  2. required String url,
  3. _Button payload = const {},
})

URL button

builder.urlButton(
 label: "Buy a coffee",
 url: "https://coffee.mania/buy"
);

Implementation

KeyboardBuilder urlButton(
    {required String label,
    required String url,
    _Button payload = const {}}) {
  if (label.length > 40) {
    throw RangeError('Maximum length of label 40 characters');
  }

  return _addWideButton({
    'action': {
      'label': label,
      'payload': _serializePayload(payload),
      'link': url,
      'type': 'open_link'
    }
  });
}