ini 0.0.4 copy "ini: ^0.0.4" to clipboard
ini: ^0.0.4 copied to clipboard

outdatedDart 1 only

Read and write .ini files

example/example.dart

import 'package:ini/ini.dart';
import 'dart:io';

File file = new File("example/config.ini");

void do_config_things (Config config, String label) {
  print("${label}: loaded config from ${file.path}");
  print('');

  print("${label}: Read some values...");
  print("${label}: ${config.has_option('default', 'default')}");
  print("${label}: ${config.defaults()["default"]}");
  print("${label}: ${config.get("section", "section")}");
  print('');

  print("${label}: Write some values...");
  config.add_section("new");
  config.set("new", "entry", "result");
  print("${label}: Added a new section and entry");
  print('');

  print("${label}: Write out config (to screen)");
  print("${label}: ${config.toString()}");
}

main() {
  Config.readFile(file)
    .then((Config config) {
      do_config_things(config, "async");
    });

  Config config = Config.readFileSync(file);
  do_config_things(config, "sync ");
}
22
likes
0
pub points
91%
popularity

Publisher

unverified uploader

Read and write .ini files

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

unittest

More

Packages that depend on ini