Check out example codes for "test reports in unit tests flutter". It will help you in understanding the concepts better.

Code Example 1

flutter pub getflutter pub global activate junitreport

Code Example 2

flutter test --machine | tojunit --output <Your output file>.xml

Learn ReactJs, React Native from akashmittal.com