Skip to content
pubscout

cqrs

10.1.0+1, released 9 months ago by leancode.co

A library for communication with CQRS-compatible backends using queries and commands.

$ flutter pub add cqrs
Source repository

What it does

Provides a client and abstractions to send queries, commands, and operations to a CQRS-compatible backend. It handles request execution and returns structured results including command successes and validation failures.

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

Use it when

  • Your backend architecture follows the CQRS pattern.
  • You need to send strongly typed queries and commands over HTTP.

Skip it when

  • Your backend uses standard REST or GraphQL without CQRS.
  • You are looking for a general-purpose HTTP client.

Strengths

  • Strongly typed query and command contracts.
  • Built-in handling for validation errors and command execution states.
  • No-throw guarantee API returning results explicitly.

Weaknesses

  • Requires a specifically CQRS-compatible backend architecture.
  • Limited to HTTP transport using the provided client.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3

Requires setting up an HTTP client and a base API Uri, then instantiating the Cqrs class.

final apiUri = Uri.parse('https://flowers.garden/api/');
final cqrs = Cqrs(loginClient, apiUri);
final flowers = await cqrs.get(AllFlowers(page: 1));

Alternatives

Packages that do the same job and could replace cqrs.

  • dio

    If you need a fully-featured general HTTP client with interceptors and advanced request management.

Works with

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