operator [] method Null safety

  1. @override
Future<T?> operator [](
  1. String key
)

Get the stash value for the specified key.

  • key: the key

Implementation

@override
Future<T?> operator [](String key) {
  return _primary[key]
      .then((value) => value != null ? Future.value(value) : _secondary[key]);
}