asMap method Null safety

  1. @override
Map<K, V> asMap()

Creates a Map instance that wraps the original KtMap. It acts as a view.

Mutations on the returned Map are reflected on the original KtMap and vice versa.

This method can be used to interop between the dart:collection and the kt.dart world.

  • Use iter to iterate over the elements of this KtMap using a for-loop
  • Use toMap to copy the map


Map<K, V> asMap();