Skip to content
pubscout

license_generator

2.1.0, released a year ago by icapps.com

A Dart tool to generate a license file containing all third-party library licenses.

WASM-ready
$ flutter pub add license_generator
Source repository

What it does

It downloads or gathers licenses for all packages used in your project and generates a Dart file containing them. It includes commands to check if pubspec.yaml and pubspec.lock are in sync, and supports adding extra or custom licenses.

AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to bundle third-party licenses into your app to comply with open-source requirements.
  • You want automated checking between pubspec.yaml and pubspec.lock before generating code.

Skip it when

  • You do not need to display third-party licenses in your application.
  • You prefer runtime license fetching rather than code generation.

Strengths

  • Supports checking if pubspec.yaml and pubspec.lock are in sync.
  • Allows adding extra licenses or ignoring specific packages.
  • Provides flexible logging levels (info, debug, verbose).

Weaknesses

  • Relies on specific command-line execution steps.
  • Limited built-in integration outside of the provided CLI commands.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Add license_generator to dev_dependencies and run via pub run license_generator generate.

dev_dependencies:
  license_generator: ^2.1.0

# Run command:
# pub run license_generator generate

Alternatives

Packages that do the same job and could replace license_generator.

  • mason

    Dart template generator for quick file creation

  • drift_dev

    Generates Dart database code from Drift table definitions as a dev‑dependency.

  • protobuf

    Provides runtime support for Dart protocol buffer messages generated by protoc_plugin.

  • data_class_plugin

    A tool that uses Dart's Analyzer to generate data classes, unions, and enums.

Works with

Packages commonly used together with license_generator: ones it builds on, ones built on it, and its own family.