bizz84 / coronavirus_rest_api_flutter_course

Coronavirus REST API Flutter Course

Home Page:https://courses.codewithandrea.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type 'String' is not a subtype of type 'int'

zyllus17 opened this issue · comments

I completed the entire course and it went well but in the second last video, it has been throwing this error. I don't understand where I am making the mistake.

Error :

Error

And when I check where the error is on #1 , it shows the error on

final value = sharedPreferences.getInt(endpointValueKey(endpoint));

image

I copied your entire code when I couldn't solve it yet the error doesn't go away.

@zyllus17 You may have written it once as a String by mistake, and now it fails every time when you try to read it from shared preferences.
Delete/uninstall the app, then try again.

@zyllus17 You may have written it once as a String by mistake, and now it fails every time when you try to read it from shared preferences.
Delete/uninstall the app, then try again.

Tried it and it actually worked. Thank you!