meta
1.19.0, released 4 months ago by dart.dev
Annotations to express developer intentions for static analysis tools.
What it does
Provides annotations like @visibleForTesting, @immutable, and @sealed that static analysis tools use to analyze source code and check developer intentions. It also includes experimental annotations for dart2js.
AI-written summary of version 1.19.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to guide the Dart analyzer with custom metadata on classes, methods, or variables.
- You are writing code that requires strict enforcement of architectural intentions such as mustCallSuper or immutable.
Skip it when
- You need a general-purpose state management or UI library.
- You are looking for runtime dependency injection frameworks.
Strengths
- Officially maintained by the Dart team.
- Zero dependencies.
- Directly integrates with the Dart analyzer and IDE warnings.
Weaknesses
- Provides only annotations and no runtime logic or utilities.
- Some hints/annotations may be experimental or change between minor versions.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add package to dependencies in pubspec.yaml.
import 'package:meta/meta.dart';
@immutable
class MyClass {
const MyClass();
}Alternatives
Packages that do the same job and could replace meta.
- ciach
Dead code detector for Dart and Flutter that finds and removes unused declarations.
80Compare - undead
Reachability and dead/unused declaration analysis for Dart and Flutter packages.
72Compare - cognitive_complexity
Algorithmic Cognitive Complexity calculation and Data-Flow analysis library and CLI tools.
74Compare - autopilot
A test driver for Flutter that exposes a JSON HTTP API for QA testing.
66Compare
Works with
Packages commonly used together with meta: ones it builds on, ones built on it, and its own family.
- analyzerBuilt on metaPerforms static analysis of Dart code for tool integration and embedding.
- xmlBuilt on metaFull-featured XML and XPath library for DOM parsing, SAX streaming, and fluent building.
- package_configBuilt on metaRead and write Dart package configuration files.
- petitparserBuilt on metaBuild fast, composable, and type-safe grammars and parsers in plain Dart code.
- ioBuilt on metaUtilities for the Dart VM Runtime including ANSI colors, file copying, and exit code values.
- built_valueBuilt on metaImmutable value types with builders, enum classes and JSON serialization for Dart.
- platformBuilt on metaCross‑platform abstraction for querying runtime platform info in Dart.
- coverageBuilt on metaCollects, manipulates, and formats code coverage data in Dart