decorationLabel method
The covered refusal for the one covering that is not a mistake: a text field's own decoration.
A field's labelText is a visible string, so a bare target matches
it — and matches the label Text, the one widget in that field nobody
can act on: the decoration sits under an IgnorePointer, so the pointer
at the label's centre goes to the field. The generic covered sentence is
true and useless there, because the thing "covering" the label is the
field the caller was aiming at all along.
label is {"label": …} spelled out, and it arrives only when the
resolver has just checked that it resolves — a refusal that hands back
an address it has not tried costs the reader the round trip it was
written to save. Null leaves the point, which the ladder can always
vouch for.
Implementation
String decorationLabel(
String verb,
String described, {
required String? label,
required Offset center,
}) =>
"$described belongs to a text field's decoration (its label, hint or "
'prefix), so `$prefix$verb` at its centre lands on the field. Act on '
'the field: '
'`{"at": {"x": ${center.dx.round()}, "y": ${center.dy.round()}}}`, its '
'centre'
'${label == null ? '' : ', or `{"label": ${jsonEncode(label)}}`'}.';