read<T> method

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

Typed accessor for a value in data. Returns null if missing or if the stored value is not a T.

Implementation

T? read<T>(String key) {
  final value = data?[key];
  return value is T ? value : null;
}