ReadToken() is returning "Instance of 'Future'"
I was following this tutorial on the Flutter Docs: https://docs.flutter.dev/cookbook/persistence/reading-writing-files.
So, my problem is that, if I just run ReadToken() without running the create function then the ReadToken() function always returns "Instance of 'Future'". Note: I made some changes to the ReadToken() function, like the name. The function is below.
Future<Object> readToken() async {
try {
final file = await _localFile;
// Read the file
final contents = await file.readAsString();
return contents;
} catch (e) {
// If encountering an error, return 0
return 0;
}
}
}
Is there anything that I'm doing wrong or anything that I should change?