integer method
The value parsed as an integer.
A value that is present but unparseable throws rather than falling
back to orElse. Someone set it on purpose, and silently ignoring it
would leave the app running on a port nobody routed to.
Implementation
int integer(String name, {required int orElse}) {
final value = this[name];
if (value == null) {
return orElse;
}
return int.tryParse(value) ??
(throw StateError(
'Environment variable "$name" is "$value", which is not an integer.',
));
}