import 'package:flutter/widgets.dart'; /// The browser client's cancel wording, kept verbatim. const cancelActionLabel = 'Cancel run'; const cancelDialogMessage = 'This asks the server to stop the active run.'; const cancelConfirmLabel = 'Cancel run'; const cancelKeepLabel = 'Keep'; /// Stable test/semantics keys shared by the action and its prompt. const cancelActionKey = ValueKey('cancel-run-action'); const cancelKeepKey = ValueKey('cancel-run-keep'); const cancelConfirmKey = ValueKey('cancel-run-confirm'); const cancelErrorKey = ValueKey('cancel-run-error'); /// The cancel dialog's title: `Cancel run {id}?`. String cancelDialogTitle(num runId) => 'Cancel run $runId?'; /// The server's refusal, verbatim. Only a blank error gets a generic sentence /// so the prompt never claims a cancellation that did not happen. String describeCancelError(Object error) { final message = '$error'.trim(); return message.isEmpty ? 'The server did not cancel the run.' : message; }