const int.fromEnvironment(String name, { int defaultValue })

Returns the integer value of the given environment declaration name.

The result is the same as would be returned by:

int.parse(const String.fromEnvironment(name, defaultValue: ""),
          (_) => defaultValue)

Example:

const int.fromEnvironment("defaultPort", defaultValue: 80)

Source

external const factory int.fromEnvironment(String name, {int defaultValue});