get<T> abstract method

T? get<T>(
  1. String key, [
  2. T? defaultValue
])

Retrieves the value associated with the given key.

If the key does not exist, it returns the optional defaultValue.

Example:

final port = config.get<int>('server.port', 3000);

Returns null if the key is missing and no defaultValue is provided.

Implementation

T? get<T>(String key, [T? defaultValue]);