calculateSubmap method

Map calculateSubmap(
  1. String translationKey
)

Implementation

Map<dynamic, dynamic> calculateSubmap(final String translationKey) {
  final List<String> translationKeySplitted =
      translationKey.split(this.keySeparator!);
  translationKeySplitted.removeLast();
  Map<dynamic, dynamic>? decodedSubMap = decodedMap;
  translationKeySplitted.forEach((listKey) {
    final subMap = (decodedSubMap ?? Map())[listKey];
    decodedSubMap = subMap is Map ? subMap : Map();
  });
  return decodedSubMap ?? {};
}