showAlert method
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();
}