get the value using key of map in flutter firebase code example
Example 1: flutter get key from map
String key = values.keys.elementAt(index);
Example 2: dart key value pair list
void main() {
final testMap = {"a": 1, "b": 2, "c": 3, "d": 4, "e": 5};
for (final mapEntry in testMap.entries) {
final key = mapEntry.key;
final value = mapEntry.value;
print('Key: $key, Value: $value'); // Key: a, Value: 1 ...
}
}