Skip to content
pubscout

coverage

1.16.1, released 2 days ago by tools.dart.dev

Collects, manipulates, and formats code coverage data in Dart

Rock solid
$ flutter pub add coverage
Source repository

What it does

Provides tools to collect coverage JSON from the Dart VM Service and format it into LCOV or pretty-printed formats. Supports ignoring specific lines or ranges from coverage and handling function or branch coverage.

AI-written summary of version 1.16.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to generate lcov.info files for test coverage reporting
  • You want to collect coverage data from the Dart VM Service
  • You need to filter out ignored lines using coverage comments

Skip it when

  • You are looking for a state management or UI library
  • You do not need test coverage metrics for your Dart project

Strengths

  • Supports LCOV and pretty-printed format output
  • Supports function and branch coverage collection
  • Provides comment directives to ignore lines or files from coverage

Weaknesses

  • Web coverage percentage metrics and line counts are not directly comparable to VM runs

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
12

Run dart pub global activate coverage and optionally add the executables to your PATH.

dart pub global run coverage:test_with_coverage

Works with

Packages commonly used together with coverage: ones it builds on, ones built on it, and its own family.