diff --git a/lib/src/list_map/list_map.dart b/lib/src/list_map/list_map.dart index ebff890..b160446 100644 --- a/lib/src/list_map/list_map.dart +++ b/lib/src/list_map/list_map.dart @@ -197,6 +197,21 @@ class ListMap implements Map { throw UnsupportedError("This is not yet supported, but will be in the future."); } + /// Inserts [key]/[value] at position [index]. + /// + /// If the [key] already exists, the previous one will first be removed. + /// + /// Then, it will shift all objects at or after the index towards the end of the list, + /// and add it at the given position. + /// + /// This only works if the `ListMap` is growable. + /// The [index] value must be non-negative and no greater than [length]. + /// + void insert(int index, K key, V value) { + // TODO: Implement + throw UnsupportedError("This is not yet supported, but will be in the future."); + } + @override void addEntries(Iterable> newEntries) { // TODO: Implement diff --git a/lib/src/list_map/list_map_view.dart b/lib/src/list_map/list_map_view.dart index 4f90083..44e4671 100644 --- a/lib/src/list_map/list_map_view.dart +++ b/lib/src/list_map/list_map_view.dart @@ -165,4 +165,10 @@ class ListMapView implements ListMap { // TODO: Implement throw UnsupportedError("This is not yet supported, but will be in the future."); } + + @override + void insert(int index, K key, V value) { + // TODO: Implement + throw UnsupportedError("This is not yet supported, but will be in the future."); + } }