Skip to main content

prefer-symbol-over-key

added in: 1.8.0
Pro+

Suggests using symbols instead of string keys in Patrol tests.

Example

❌ Bad:

void main() {
patrolTest('widget test', () {
...
$(Key('button')); // LINT: Prefer symbols (#) over keys.
});
}

✅ Good:

void main() {
patrolTest('widget test', () {
...
$(#button);
});
}