How can the code coverage data from Flutter tests be displayed?

You can also install lcov and convert the lcov.info file to HTML pages and then see the result in the browser with sorting option.

1. Installation

1.1. Installing in Ubuntu

sudo apt-get update -qq -y
sudo apt-get install lcov -y

1.2. Installing in Mac

brew install lcov

2. Run tests, generate coverage files and convert to HTML

flutter test --coverage
genhtml coverage/lcov.info -o coverage/html

3. Open coverage report in browser

open coverage/html/index.html

Note This way you can add it to circleci artifacts and coveralls as well.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)