getDouble method

double getDouble(
  1. String name, {
  2. double? fallback,
})

Load the enviroment variable value as a double

If variable with name does not exist then fallback will be used. However if also no fallback is supplied an error will occur.

Furthermore an FormatException will be thrown if the variable with name exists but can not be parsed as a double.

Implementation

double getDouble(String name, {double? fallback}) {
  final value = maybeGet(name);
  assert(value != null || fallback != null,
      'A non-null fallback is required for missing entries');
  return value != null ? double.parse(value) : fallback!;
}