Skip to content
pubscout

toml

0.18.0, released 11 months ago by an unverified publisher

Parse and encode TOML configuration files in Dart.

WASM-ready
$ flutter pub add toml
Source repository

What it does

Provides a TOML v1.1.0 parser that converts TOML documents to Dart maps and an encoder that converts maps back to TOML strings. Supports loading files from assets, HTTP, or local file system.

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

Use it when

  • You need to read or write TOML configuration files in a Dart or Flutter app.
  • You require a pure‑Dart solution without native dependencies.

Skip it when

  • You need a JSON‑or‑YAML‑only format or require schema validation.
  • Performance‑critical parsing of extremely large files is needed.

Strengths

  • Full TOML 1.1 support including inline tables and new escape sequences
  • Works on all Dart platforms (mobile, web, desktop)
  • No native code, easy to add as a dependency

Weaknesses

  • Only supports TOML; no other config formats
  • Encoder does not produce inline tables or dotted keys

Setup

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

void main() async {
  var doc = await TomlDocument.load('config.toml');
  var map = doc.toMap();
  print(map);

  var encoded = TomlDocument.fromMap(map).toString();
  print(encoded);
}

Alternatives

Packages that do the same job and could replace toml.

  • yaml

    If your configuration is in YAML instead of TOML, the yaml package provides similar parsing capabilities.

Works with

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