flutter_unused_code 0.1.0
flutter_unused_code: ^0.1.0 copied to clipboard
Finds dead code in Dart and Flutter projects - unused files, declarations, public members and widgets - using a resolved reference graph.
0.1.0 #
First release.
- Resolved reference graph built with
package:analyzer(no regex). - Reports unused files (unreachable from entry points through imports, exports, parts and every conditional-import branch), unused top-level declarations, unused public members, and unused widgets as a highlighted subset.
- Liveness is mark-and-sweep: a reference only counts when the code it sits
in is alive, so a widget kept "alive" only by its own
Stateclass is reported. - False-positive guards: overrides and interface implementations, Flutter
lifecycle callbacks,
toJson/fromJson/copyWithconventions, generated code (*.g.dart,*.freezed.dart, ...) counted as references but never reported,@pragma('vm:entry-point'), code-generation annotations,@visibleForTesting,// unused_code:ignoreand// unused_code:ignore_file. unused_code.yaml:exclude,entry_points,ignore_names,keep_annotations,count_test_usage,mode.- Output: text (grouped by file, with removable-line estimate),
json,markdown,githubannotations;--fail-on-unusedfor CI.