Ok I found it. I will leave the anwser here in case it maybe helpful for anyone.
Actually genhtml is a perl
script. If you are have git bash installed, you should have perl already. Try where perl
on the cmd
and it will show you the path.
For me it was at C:\Program Files\Git\usr\bin\perl.exe
Now create a file called genhtml.perl
inside your flutter project root directory. (Make sure to .gitignore
it)
Then in the file, copy and paste the content this https://raw.githubusercontent.com/valbok/lcov/master/genhtml.perl
Finally open git bash and run $ ./genhtml.perl ./coverage/lcov.info -o coverage/html
.
Check You are done html files at coverage/html
.
On android studio, select index.html
then CTRL+SHIFT+C
to copy the file path.
Open Chrome and on the url bar add file:///
+CTRL+V
. Tap enter. You are done.
PS : Who so ever is facing an error like No common filename prefix found!
or some other issue, they can try replacing content of genhtml.perl
file from below link.
https://raw.githubusercontent.com/linux-test-project/lcov/master/bin/genhtml
Can't locate DateTime.pm in @INC (you may need to install the DateTime module) (@INC contains: /usr/lib/perl5/site_perb/perl5/core_perl /usr/share/perl5/core_perl) at ./genhtml.perl line 87. BEGIN failed--compilation aborted at ./genhtml.perl line 87.
– Felice