requiresFlutterImport property
bool
get
requiresFlutterImport
Whether this rule only applies to files that import Flutter.
If true, the rule is skipped for files without package:flutter/ imports.
Uses cached FileMetrics for O(1) lookup after first computation.
Example: Widget-specific rules:
@override
bool get requiresFlutterImport => true;
Impact: Skips ~300+ widget rules instantly for pure Dart files.
Default: false (runs on all files)
Implementation
bool get requiresFlutterImport => false;