showAlert method

void showAlert(
  1. AlertMessage alert, {
  2. DateTime? time,
})
inherited

Shows alert, replacing any previous one. A copyable segment is copied to the clipboard immediately. time is shown alongside the alert.

Implementation

void showAlert(AlertMessage alert, {DateTime? time}) {
  state.alert = alert;
  state.alertTime = time;
  if (alert.copyText case final text?) {
    copyToClipboard(text);
  }
  markDirty();
}