rc 0.0.2 copy "rc: ^0.0.2" to clipboard
rc: ^0.0.2 copied to clipboard

outdated

A Dart application runtime configuration library, Parse configuration file resolved environment variables and path.

example/main.dart

import 'dart:io';

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

void printMessage(String first, dynamic last) =>
    print('${first.padRight(40)} -> $last');

/// String contents example.
void stringExample() {
  final String contents = '''
# One configuration.
one = This is one configuration.
two = \${one}
''';

  final rc = RuntimeConfiguration(contents: contents)..load();

  printMessage('one value', rc('one'));
  printMessage('one equals two', rc('one') == rc('two'));
}

/// File example.
void fileExample() {
  final rc = createRuntimeConfigurationFromFile(File('.rc'))..load();

  printMessage('path one', rc('path1'));
  printMessage('Int value', rc('int'));
  printMessage('Double value', rc('double'));
  printMessage('Bool value', rc('true'));
  printMessage('Null value', rc('null1'));
}

void main() {
  stringExample();
  fileExample();
}
1
likes
0
pub points
7%
popularity

Publisher

verified publisherodroe.dev

A Dart application runtime configuration library, Parse configuration file resolved environment variables and path.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

path

More

Packages that depend on rc