Skip to content
pubscout

cucumber_messages

35.0.0, released 9 days ago by cucumber.io

Dart types and helpers for Cucumber message protocol (NDJSON).

WASM-ready
$ flutter pub add cucumber_messages
Source repository

What it does

Provides generated Dart classes for all Cucumber message schemas. Includes utilities for reading and writing NDJSON streams, timestamps, and durations.

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

Use it when

  • You need to exchange Cucumber messages between processes in Dart/Flutter
  • You want strongly‑typed access to Cucumber JSON schema data
  • You need NDJSON stream support for test results

Skip it when

  • You only need simple JSON parsing without generated models
  • You are not using Cucumber or BDD testing

Strengths

  • Fully generated from official Cucumber JSON schemas
  • Zero runtime dependencies
  • Supports NDJSON streaming out of the box

Weaknesses

  • No runtime features beyond generated models
  • No built‑in test runner or BDD framework

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:cucumber_messages/cucumber_messages.dart';

void main() async {
  final stream = NDJsonReader(stdin);
  await for (final message in stream.read()) {
    if (message is Envelope) {
      print('Got ${message.messageCase}');
    }
  }
}

Alternatives

Packages that do the same job and could replace cucumber_messages.

  • json_annotation

    If you prefer manual JSON serialization with annotations instead of generated schema types

Works with

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