Hello, I had problems getting data from an instance of SharedPreferences, this is my code:
_getToken() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
var token = (prefs.getInt('TOKEN') ?? "");
print(token);
}
when starting the program shows the following error:
ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, Object>' where
_InternalLinkedHashMap is from dart:collection
Map is from dart:core
String is from dart:core
Object is from dart:core