putIfAbsent abstract method

Uint8List putIfAbsent(
  1. Uint8List key,
  2. Uint8List value
)

Add a key, value pair to the underlying store if not key is in the underlying store. Returns the old value if key existed, otherwise value is returned.

putIfAbsent(utf8.encode('foo',utf8.encode('bar')
putIfAbsent(utf8.encode('foo',utf8.encode('baz') // returns 'bar'
get(utf8.encode('foo'); // returns 'bar'

Implementation

Uint8List putIfAbsent(Uint8List key, Uint8List value);