option<T> method

T? option<T>(
  1. String key
)

Retrieves the value of type T associated with the given key in the configuration.

Returns null if the value is not of type T or does not exist.

Implementation

T? option<T>(String key) {
  final value = configuration[key];
  if (value is T) {
    return value;
  }
  return null;
}