dart_pubspec_licenses
3.2.0, released 9 months ago by espresso3389.jp
Extracts open source license information from Dart packages using pubspec.yaml
What it does
Reads the project's pubspec.lock to gather and assemble open source software license details. Generates a Dart file or a JSON file containing all package metadata and licenses.
AI-written summary of version 3.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display an open source licenses page in your mobile, desktop, or web application
- You want to automate license information collection during your build or release process
Skip it when
- You need runtime dynamic extraction of licenses without pre-generating a file
Strengths
- Supports generating either a Dart constant file or a JSON file
- Detects SPDX license identifiers automatically
- Handles complex workspaces and package directories
Weaknesses
- Requires pub get / pub upgrade to be run before generating licenses
- Does nothing at runtime as it is purely a build-time tool
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 5
Add the package to dev_dependencies in pubspec.yaml and run dart run dart_pubspec_licenses:generate
dev_dependencies:
dart_pubspec_licenses: ^3.2.0
# Run command:
dart run dart_pubspec_licenses:generateAlternatives
Packages that do the same job and could replace dart_pubspec_licenses.
- pubspec_parse
Parse pubspec.yaml files with a type‑safe API and detailed error reporting.
93Compare - pubspec_manager
Type-safe API to read, modify, and write pubspec.yaml while preserving comments.
78Compare - yaml_modify
A library for modifying YAML files.
44Compare - json2yaml
Converts JSON maps to YAML strings with beautification and pubspec conventions.
50Compare
Works with
Packages commonly used together with dart_pubspec_licenses: ones it builds on, ones built on it, and its own family.
- yamldart_pubspec_licenses depends on itA Dart library for parsing YAML documents into Dart data structures.
- json_annotationdart_pubspec_licenses depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- argsdart_pubspec_licenses depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- panadart_pubspec_licenses depends on itProduce a report summarizing the health and quality of a Dart package
- flutter_oss_licensesBuilt on dart_pubspec_licensesGenerates a detailed OSS license list from pubspec.yaml and lock files.