flutter_unused_code 0.1.0 copy "flutter_unused_code: ^0.1.0" to clipboard
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 State class is reported.
  • False-positive guards: overrides and interface implementations, Flutter lifecycle callbacks, toJson/fromJson/copyWith conventions, generated code (*.g.dart, *.freezed.dart, ...) counted as references but never reported, @pragma('vm:entry-point'), code-generation annotations, @visibleForTesting, // unused_code:ignore and // 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, github annotations; --fail-on-unused for CI.
0
likes
160
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Finds dead code in Dart and Flutter projects - unused files, declarations, public members and widgets - using a resolved reference graph.

Repository (GitHub)
View/report issues

Topics

#dead-code #static-analysis #flutter #cli #lints

License

MIT (license)

Dependencies

analyzer, args, glob, path, yaml

More

Packages that depend on flutter_unused_code