//The getter 'length' isn't defined for the class 'Future<List<String>>'.
//Error: The operator '[]' isn't defined for the class 'Future<List<String>>'.
The messages are quite clear. Your
sharedprefernces
class does not have a
length
property, or an indexer. You need to add those to your class or inherit from a class that does provide them.