settings_yaml 3.0.1 copy "settings_yaml: ^3.0.1" to clipboard
settings_yaml: ^3.0.1 copied to clipboard

outdated

Provides a simple means of saving/loading settings from a yaml file without the yaml fuss.

example/example.dart

import 'package:settings_yaml/settings_yaml.dart';

void main() {
  save();

  load();
}

void save() {
  var settings = SettingsYaml.load(pathToSettings: '.settings.yaml');

  settings['dbname'] = 'billing';
  settings['dbusername'] = 'username';
  settings['dbpassword'] = 'apassword';
  settings['timeout'] = 300;
  settings['coefficient'] = 10.85;

  settings.save();
}

void load() {
  var settings = SettingsYaml.load(pathToSettings: '.settings.yaml');

  var dbname = settings['dbname'];
  var username = settings['dbusername'];
  var password = settings['dbpassword'];
  var timeout = settings['timeout'];
  var coefficient = settings['coefficient'];

  print('dbname $dbname, username: $username, password: $password, timeout: $timeout, coefficient: $coefficient');

  settings.save();
}
15
likes
0
pub points
80%
popularity

Publisher

verified publisheronepub.dev

Provides a simple means of saving/loading settings from a yaml file without the yaml fuss.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta, path, uuid, yaml

More

Packages that depend on settings_yaml