flutter_spm_doctor 0.2.0 copy "flutter_spm_doctor: ^0.2.0" to clipboard
flutter_spm_doctor: ^0.2.0 copied to clipboard

Flutter migration doctor — checks plugin dependencies for Swift Package Manager, UIScene lifecycle, and Android 16KB page-size alignment readiness.

example/flutter_spm_doctor_example.dart

// ignore_for_file: avoid_print
//
// This example shows how to use flutter_spm_doctor's library API directly,
// instead of via the CLI. Run it with:
//
//   dart run example/flutter_spm_doctor_example.dart
import 'package:http/http.dart' as http;
import 'package:flutter_spm_doctor/flutter_spm_doctor.dart';

Future<void> main() async {
  final client = http.Client();
  final cache = CacheService();
  final pubClient = PubDevClient(client, cache);
  final githubClient = GithubClient(client, cache);
  final checker = SpmChecker(pubClient, githubClient);

  // Check a handful of well-known plugins for SPM support.
  const packagesToCheck = {
    'url_launcher': '6.3.0',
    'package_info_plus': '8.0.0',
  };

  final plugins = <PluginInfo>[];
  for (final entry in packagesToCheck.entries) {
    final plugin = await checker.checkPlugin(entry.key, entry.value);
    if (plugin != null) {
      plugins.add(plugin);
    }
  }

  client.close();

  ConsoleReporter().report(plugins);

  // You can also generate a ready-to-paste GitHub issue body for a plugin
  // that doesn't support SPM yet:
  IssueTemplate.printTemplate('some_outdated_plugin');
}
1
likes
160
points
62
downloads

Documentation

API reference

Publisher

verified publishermuneerhasan.com

Weekly Downloads

Flutter migration doctor — checks plugin dependencies for Swift Package Manager, UIScene lifecycle, and Android 16KB page-size alignment readiness.

Repository (GitHub)

Topics

#flutter #ios #android #migration #cli

License

MIT (license)

Dependencies

ansi_styles, archive, args, http, path, yaml

More

Packages that depend on flutter_spm_doctor