nullIfEmpty method

  1. @useResult
Map<K, V>? nullIfEmpty()

Returns this map, or null if it is empty. Audited: 2026-06-12 11:26 EDT

Implementation

@useResult
Map<K, V>? nullIfEmpty() => isEmpty ? null : this;