getOrFail method Null safety

String getOrFail(
  1. String key,
  2. {String? message}
)

Get environment key from .env file

Implementation

String getOrFail (String key, { String? message }) {
  final result = get(key);
  if (result == null) {
    throw NotExist(prefix: 'Missing value', cause: message ?? 'No values are attached to $key key.');
  }

  return result;
}