Issue
is there a solution to this problem?? *
Invalid radix-10 number (at character 1) null ^
child: Column(
children: [
...(question[questionIndex]['answer']as List<Map<String,Object>>).map((value){
return Answer(()=> answerQuestion(int.parse(value['Score'].toString()))! ,value['text'].toString());
}).toList() ,
],
),
Solution
This FormatException
gets thrown when int.parse
tries to parse a String that does not contain numbers only.
In your case, value['Score']
is null
, which is definitely not a number.
So to fix your error you need to either
- Check
value['Score']
fornull
and, if it is null, not try to parse it - Make sure that it contains a valid, parseable number (Maybe you meant the lowercase
value['score']
?)
Answered By - LinuCC
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.