extractMap method
Return an Option that conditionally accesses map keys, if they contain a map with the same key type. Useful for accessing nested JSON.
expect(
some({ 'test': { 'foo': 'bar' } }).extractMap('test'),
some({ 'foo': 'bar' }),
);
Implementation
Option<Map<K, dynamic>> extractMap(K key) => extract<Map<K, dynamic>>(key);