Skip to content
pubscout

mason_api

0.1.2, released 2 months ago by brickhub.dev

Dart API client for Mason CLI

$ flutter pub add mason_api
Source repository

What it does

Provides methods to login, logout, query current user, search, and publish templates to a Mason server. It handles authentication and HTTP communication.

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

Use it when

  • You need programmatic access to a Mason server from Dart code
  • You want to integrate Mason template publishing into a build or CI pipeline
  • You need custom hosted URI support

Skip it when

  • You only need the Mason CLI and no custom Dart integration
  • You are building a UI that does not interact with Mason server

Strengths

  • Simple API, no code generation required
  • Supports custom hosted URI
  • Built on stable http package
  • Lightweight

Weaknesses

  • Limited to Mason server features
  • No advanced networking features like retries or interceptors
  • No built-in error handling beyond basic exceptions

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
6
import 'package:mason_api/mason_api.dart';

const email = 'my@email.com';
const password = 'top-secret!';

Future<void> main() async {
  final masonApi = MasonApi();
  final user = await masonApi.login(email: email, password: password);
  print('Logged in as ${user.email}!');
  masonApi.logout();
  print('Logged out!');
  masonApi.close();
}

Alternatives

Packages that do the same job and could replace mason_api.

  • chopper

    An HTTP client generator for Dart and Flutter using source_gen.

  • retrofit

    Dart Dio client generator using source_gen

  • shelf_easy

    Lightweight framework with a JSON model generator, database operator, and web/WebSocket server/client.

  • vmodal_sdk_flutter

    Typed VModal API client for Flutter to upload videos and search moments by meaning.

Works with

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