initialize static method

Future<void> initialize(
  1. String key, {
  2. IEncryptor? encryptor,
})

Initialize the EncryptedSharedPreferences with the provided encryption key.

Implementation

static Future<void> initialize(String key, {IEncryptor? encryptor}) async {
  _key = key;
  _decorator = SharedPreferencesDecorator(
    encryptor: encryptor ?? AESEncryptor(),
    key: _key!,
    preferences: await SharedPreferences.getInstance(),
  );
}