show method

void show(
  1. String message, {
  2. String kind = '',
})

Shows a neutral toast.

Implementation

void show(String message, {String kind = ''}) {
  final classes = kind.isEmpty ? 'toast' : 'toast $kind';
  final toast = el('div', classes: classes, role: 'status', text: message);
  _host.appendChild(toast);
  Timer(ttl, () {
    if (toast.parentNode != null) toast.remove();
  });
}