retrieve document field from firestore

Some programs I am writing need (or at least I think they need) to get the Firestore data and modify it. I'm okay with modifying, but the ways I've found to retrieve are not working and it keeps passing an error: "The operator '[]' isn't defined for the type 'Object'.
Try defining the operator '[]'" similar to this. It is right at the 'elo' and I am 100% sure that elo is correctly defined in the user document in Firestore. Is there another workaround? Here is some sample code for a method of retrieving the data. (for context, it's taking in a user reference as a parameter)

int? userElo;

users?.get().then((DocumentSnapshot snapshot) {

ย  if (snapshot.exists) {

ย  ย  Map<String, dynamic> data = snapshot.data() as Map<String, dynamic>;

ย  ย  userElo = data['elo'] as int?;

ย  }return userElo;


another way that is still throwing an error is:
myTurnUsers.sort((a, b) => user1.get('joinMatchTime').compareTo(user2.get('joinMatchTime')));

specifically the 'joinMatchTime" is underlined even though it is definitely spelled right in Firestore.

By the way, one of the two programs I am making (the simpler one) is just sorting ranks of users in order of elo. So for example the user with the most elo is rank 1 and ranks are in descending order from rank. The harder example of what I'm trying to do is an action that changes who's turn it is: set the user myTurn = true and it sets it in order of joinMatchTime and goes back to the first user when it reaches the end. For example, three iterations of the action would look like this:
0 1 0 0 0

0 0 1 0 0

0 0 0 1 0

They are ordered by joinMatchTime (dateTime) and the binary values represent myTurn=true.

If there is a simpler way of doing this without referencing firestore that you know of, let me know! it would be very helpful. Thank you to any one in advance.

2