Skip to main content

prefer-custom-finder-over-find

added in: 1.8.0

Suggests using custom finders instead of find in Patrol tests.

Example

❌ Bad:

void main() {
patrolTest('widget test', () {
...
find.byType(SomeType); // LINT
find.text('SomeText'); // LINT
});
}

✅ Good:

void main() {
patrolTest('widget test', () {
...
$(SomeType);
$('SomeText');
});
}