printStats function

void printStats(
  1. List<String> incompatiblePackages,
  2. String platform,
  3. int totalPackages
)

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');
  }
}