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

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());
}
6
likes
130
pub points
76%
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

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

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

More

Packages that depend on license_checker