remove 方法
- Object? key
override
从该映射中移除(如果存在)键 key 及其关联的值。
返回移除前的与 key 相关联的值。如果 key 不在该映射中,则返回 null。
注意,某些映射允许 null 作为值,因此返回值为 null 并不总意味着该键不存在。
final terrestrial = <int, String>{1: 'Mercury', 2: 'Venus', 3: 'Earth'};
final removedValue = terrestrial.remove(2); // Venus
print(terrestrial); // {1: Mercury, 3: Earth}
实现
V? remove(Object? key) => _map.remove(key);