getIndexForGivenKey method
Return the index for the given key for thelabelWithValue
Implementation
int getIndexForGivenKey(K key) {
int index = 0;
labelWithValue.entries
.toList()
.asMap()
.entries
.map((e) => (e.value.key == key) ? (index = e.key) : 0)
.toList();
return index;
}