prefixKeys<V> method

Map<String, V> prefixKeys<V>(
  1. String prefix
)

Add prefix to all keys in the map. Returns a new map with prefixed keys.

Implementation

Map<String, V> prefixKeys<V>(String prefix) {
  final map = <String, V>{};
  for (final key in keys) {
    map['$prefix$key'] = this[key] as V;
  }
  return map;
}