save method
Save the object to secure storage using a unique key
.
E.g. User class
User user = new User(); user.name = "Anthony"; user.save('com.company.app.auth_user');
Get user User user = await NyStorage.read
Implementation
Future save(String key, {bool inBackpack = false}) async {
await NyStorage.store(key, this);
if (inBackpack == true) {
Backpack.instance.set(key, this);
}
}