license_checker 1.4.0 copy "license_checker: ^1.4.0" to clipboard
license_checker: ^1.4.0 copied to clipboard

outdated

A tool to view and check the licenses of a package's dependencies. It also generates a disclaimer file containing all the package licenses.

example/license_checker.dart

// Library file usage

import 'dart:io';

import 'package:license_checker/src/config.dart';
import 'package:license_checker/src/check_license.dart';
import 'package:license_checker/src/dependency_checker.dart';
import 'package:license_checker/src/package_checker.dart';

void main() async {
  // Load the config file
  Config config = Config.fromFile(File('../test/fixtures/valid_config.yaaml'));

  // Get the package configuration from the current directory
  PackageChecker packageConfig =
      await PackageChecker.fromCurrentDirectory(config: config);

  // Run the license check on all packages
  List<LicenseDisplayWithPriority<String>> lic =
      await checkAllPackageLicenses<String>(
    packageConfig: packageConfig,
    showDirectDepsOnly: true,
    filterApproved: false,
    licenseDisplay: ({
      required String licenseName,
      required String packageName,
      required LicenseStatus licenseStatus,
    }) =>
        '$packageName $licenseName ${licenseStatus.toString()}',
  );

  print(lic.toString());
}
7
likes
0
pub points
79%
popularity

Publisher

verified publisherzurita-rufer.com

A tool to view and check the licenses of a package's dependencies. It also generates a disclaimer file containing all the package licenses.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, barbecue, colorize, io, package_config, pana, path, yaml

More

Packages that depend on license_checker