getAndRemove method
Removes the entry for a key only if currently mapped to some value.
key: key with which the specified value is associated
Returns the value if one existed or null if no mapping existed for this key
Implementation
@override
Future<dynamic> getAndRemove(String key) {
return _primary.getAndRemove(key).then((value) {
if (value == null) {
return _secondary.getAndRemove(key);
}
return _secondary.remove(key).then((any) => value);
});
}