flutter – widget tests – why my line coverage not reflected for super constructor call?

Issue

I have few widgets under test and their super constructor doesn’t gets called (some it works fine and for others it won’t work as expected after many different tries)

line coverage – super(key: key) shows in RED for coverage.

Attaching few images for references..

Not working as expected

UserAvatar AppCahcedNetworkImage

Working as expected

RoundIconButton AppFlare

Coverage

Solution

This is expected behavior.

Source: https://github.com/dart-lang/sdk/issues/38934#issuecomment-803938315

Answered By – Muhammad Alif Akbar

Answer Checked By – Pedro (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.