writeData static method
Writes provided data under provided key in shared preferences. Data is encrypted using AES. Returns true if data is successfully saved.
Implementation
static Future<bool> writeData(String key, String data) async {
var result =
await _channel.invokeMethod('writeData', {'key': key, 'data': data});
if (result == true) {
return true;
} else {
throw SharedPreferencesException(
'Writing to shared preferences failed. Consider reopening or reinstalling the app.');
}
}