String key = _allMatches.elementAt(index);
Your element at the index is not a string. And you know that. It consists of username and user_id, it’s another map, you are already using it correctly elsewhere.
CLICK HERE to find out more related problems solutions.