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

outdated

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

Provide a very simple method to use yaml files for saving an apps configuration.

Saving config data:

void save() {
  /// create a new .settings.yaml
  var settings = SimpleYaml(filePath: '.settings.yaml');

  settings['dbname'] = 'billing';
  settings['dbusername'] = 'username';
  settings['dbpassword'] = 'apassword';

  settings.save();
}

Loading config data.

void load() {

  /// load an existing .settings.yaml
  var settings = SimpleYaml.load(filePath: '.settings.yaml');

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

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

  /// change something

  var newPassword = ask('password');
  settings['dbpassword'] = newPassword;

  settings.save();
}
16
likes
0
pub points
73%
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

dshell, meta, yaml

More

Packages that depend on settings_yaml