printStats function
Prints statistics about incompatible packages for a given platform. Parameters:
- incompatiblePackages: List of incompatible package names.
- platform: The name of the platform being checked.
- totalPackages: Total number of packages being checked.
Implementation
void printStats(
List<String> incompatiblePackages, String platform, int totalPackages) {
double incompatiblePercentage =
(incompatiblePackages.length / totalPackages) * 100;
print('Platform: ${platform.toUpperCase()}');
print('Total Packages: $totalPackages');
print('Incompatible Packages: ${incompatiblePackages.length}');
print('Percentage of Incompatible Packages: $incompatiblePercentage%');
print('Incompatible Packages:');
for (var package in incompatiblePackages) {
print('- $package');
}
}