ConfigParser class

App configuration parsed from environment variables and command line arguments.

Define configuration parameters first by instantiating ConfigParser and calling setOption then call parse to receive the detected values.

Values are detected in the following order with each step overriding values set by a previous step:

  1. default values
  2. environment values
  3. command line arguments

Constructors

ConfigParser()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addOption(String name, {String? abbr, String? description, String? environment, Type type = String, bool required = false, dynamic defaultValue}) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse([List<String>? args]) Map<String, dynamic>
Parse configuration from environment and (optional) cli arguments.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

allowedTypes → const List<Type>