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

outdated

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

example/main.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);

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

/// File example.
void fileExample() {
  final rc = RuntimeConfiguration.from('.rc');

  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