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);