There are many packages to make screenshot tests in Flutter. I've been using the first-party Flutter tool. See https://api.flutter.dev/flutter/flutter_test/matchesGoldenFile.html.
Basic usage
As explained, it's pretty straightforward. You write your expectation as:
await expectLater(find.byType(MyWidget), matchesGoldenFile('goldens/my_widget.png'));
Then