sultanshah rajguru
sultanshah rajguru

Reputation: 49

The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'Map<String, dynamic>'. The error is showed in the screenshot below

Hello, I've been trying to make a Quiz application in Flutter and came upon this error. I am trying to connect my app to the Firebase Firestore database but can't go further that this. Thank you for the help :)

Upvotes: 1

Views: 1290

Answers (1)

Aloysius Samuel
Aloysius Samuel

Reputation: 1200

The collection Quiz is expecting a type Map<String, dynamic> and you are setting the quizData as Map<dynamic, dynamic>.

For the problem to be solved you need to define the quizData in the expected format. Look at the code change below:

Future<void> addQuizData(Map<String, dynamic> quizData, String quizId)

Upvotes: 1

Related Questions