Home > Net >  Error: Expected a value of type 'int', but got one of type 'String' Android Stud
Error: Expected a value of type 'int', but got one of type 'String' Android Stud

Time:05-10

After the update, I started to get such an error, there was no problem before the update, the application builds but does not open

Error: Expected a value of type 'int', but got one of type 'String'
at Object.throw_ [as throw] (http://localhost:49183/dart_sdk.js:5391:11)
at Object.castError (http://localhost:49183/dart_sdk.js:5348:15)
at Object.cast [as as] (http://localhost:49183/dart_sdk.js:5680:17)
at dart.LegacyType.new.as (http://localhost:49183/dart_sdk.js:7335:60)
at new module_model.ModuleModel.fromJson 

screenshot

I'm new to Flutter and my english might be a bit bad, sorry for that, thanks.

CodePudding user response:

Most likely instead of add a number you added the number with quotes.

1 is a number

"1" is a string

Try to see if that's your case.

CodePudding user response:

Here is your solution, you can try it ->

int.parse(your_values)
  • Related