fetchGooglePackages method

Future<List<String>> fetchGooglePackages({
  1. List<String> tags = const [],
})

Retrieves all Google packages from pub.dev Mostly used as an internal tool to generate google_packages_list.dart You should probably use that instead

Implementation

Future<List<String>> fetchGooglePackages({
  List<String> tags = const [],
}) async {
  /// List of Google publishers on pub.dev
  const publishers = [
    'flutter.dev',
    'dart.dev',
    'material.io',
    'firebase.google.com',
    'google.dev',
    'tools.dart.dev ',
  ];

  final futures = <Future<List<PackageResult>>>[];
  for (var publisher in publishers) {
    futures.add(fetchPublisherPackages(publisher, tags: tags));
  }
  final results = await Future.wait(futures);
  final flatResults = results.expand((r) => r).toList();
  return flatResults.map((r) => r.package).toList();
}