Skip to content
pubscout

settings_yaml

8.3.2, released 3 weeks ago by onepub.dev

Read and write application settings to a YAML file using simple Dart maps and lists.

$ flutter pub add settings_yaml
Source repository

What it does

The package loads a YAML file into a mutable map, lets you modify values via map syntax or typed selectors, and saves the updated configuration back to disk. It validates types, limits recursion, and provides secure, staged file writes on all major desktop platforms.

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

Use it when

  • You need a lightweight, file‑based configuration store without a full database.
  • You want YAML format for human‑readable settings and prefer direct map access over code‑generated models.

Skip it when

  • You require encrypted or secure storage beyond file permissions.
  • You need reactive state management that automatically notifies UI on changes.

Strengths

  • Simple API that mirrors Dart collections.
  • Cross‑platform safe save adapters with ACL handling.
  • Built‑in validation, cycle detection and resource limits.

Weaknesses

  • No built‑in encryption or secure vault features.
  • Does not provide change notifications or reactive streams.
  • Limited to YAML files; not suitable for large or relational data.

Setup

Kind
FFI (native library)
Effort
Low
Code generation
No
Direct dependencies
6
import 'package:settings_yaml/settings_yaml.dart';

Future<void> main() async {
  final settings = SettingsYaml.load(pathToSettings: '.settings.yaml');
  settings['name'] = 'billing';
  settings['timeout'] = 200;
  await settings.save();

  final reloaded = SettingsYaml.load(pathToSettings: '.settings.yaml');
  print(reloaded.asInt('timeout'));
}

Alternatives

Packages that do the same job and could replace settings_yaml.

Works with

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