Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to use sharedpreferences in flutter, but I have a question. The shared preferences seem to be working, but I can't use the getter, cause its async, and I am getting the following error:
Type <Future>int is not a subtype of type int

How can I keep using shared preferences and fix this problem, since I only need the value.

What I have tried:

sharedprefernces().setcom(index);
//log(colores[index]);
comun(sharedprefernces().getcom, context);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900