Skip to content
pubscout

meta

1.19.0, released 4 months ago by dart.dev

Annotations to express developer intentions for static analysis tools.

WASM-readyRock solid
$ flutter pub add meta
Source repository

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.

  • undead

    Reachability and dead/unused declaration analysis for Dart and Flutter packages.

  • cognitive_complexity

    Algorithmic Cognitive Complexity calculation and Data-Flow analysis library and CLI tools.

  • autopilot

    A test driver for Flutter that exposes a JSON HTTP API for QA testing.

Works with

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