Привет, я новичок в разработке мобильных приложений и слежу за курсом udemy. Я застрял в одной точке, где инструктор может создать переменную с картами и буквальную переменную, тогда как в моем редакторе я получаю эту ошибку, которая говорит:
This literal contains both 'Map' and 'Iterable' spreads, which makes it impossible to determine whether the literal is a map or a set. Try removing or changing some of the elements so that all of the elements are consistent
Я проверял код много раз с одним с инструктор, а также проверил официальную документацию Dart, но не смог решить эту проблему. Пожалуйста, если кто-нибудь может мне помочь. Спасибо.
final _questions = const [
{
'questionText':
'Who is the current president of The United Stated of America?',
'answers': [
{'text': 'Donald Trump', 'score': 10},
{'text': 'Ram Nath Kovind', 'score': -10},
{'text': 'Pedro Sánchez', 'score': -10},
],
},
{
'questionText': 'Which of these is the currency used in Japan?',
'answers': {'text': 'Ringgit', 'score': -10},
{'text': 'Yuan', 'score': -10},
{'text': 'Yen', 'score': 10},
},
{
'questionText': 'Which of these is the capital of Spain?',
'answers': {'text': 'Madrid', 'score': 10},
{'text': 'Washington DC', 'score': -10},
{'text': 'Moscow', 'score': -10},
},
{
'questionText': 'Which one is the language of Israel?',
'answers': {'text': 'Persian', 'score': -10},
{'text': 'Hebrew', 'score': 10},
{'text': 'Turkish', 'score': -10},
},
{
'questionText': 'Who among these was the Missile Man of India?',
'answers': {'text': 'Pranab Mukherjee', 'score': -10},
{'text': 'Sir APJ Abdul Kalam', 'score': 10},
{'text': 'Bhagat Singh', 'score': -10},
},
];
Это переменная, которая содержит некоторый набор вопросов. Скриншот кода
Дополнительную информацию об ошибке можно найти на скриншоте.