Skip to content

Upgrading flutter_secure_storage 9 to 10

Breaking9.2.4 → 10.3.4Breaking7Platform8Deprecated5New20Changed27Fixed41Other17

BreakingUpgrade verdict

7 breaking changes and 7 platform requirement changes.

  • By default the plugin now wipes stored data when it hits an error, because such errors usually cannot be recovered.
  • Android now encrypts keys with a different default algorithm.
  • Android now encrypts stored values with a different default algorithm.
  • The web implementation no longer uses the old JavaScript interop package.
Top 5 of 18 that need code or config changes

Dart SDK requirement changed in 10.0.0-beta.1: >=2.12.0 <4.0.0 → >=3.3.0 <4.0.0.

Flutter requirement changed in 10.0.0-beta.1: >=2.0.0 → >=3.19.0.

Breaking7
Makes resetOnError default to true since most errors are unrecoverable key storage problems; can be disabled with resetOnError: false.
resetOnError
Changes the default key cipher to RSA_ECB_OAEPwithSHA_256andMGF1Padding.
RSA_ECB_OAEPwithSHA_256andMGF1Padding
Changes the default storage cipher to AES_GCM_NoPadding.
AES_GCM_NoPadding
Removes the js dependency in favor of js-interop on Web.
js
Enables encryptedSharedPreferences by default and makes it impossible to disable.
encryptedSharedPreferences
Merges iOS and macOS implementations into the unified flutter_secure_storage_darwin package.
flutter_secure_storage_darwin
Writes encrypted data to files instead of the Windows credential system.
Platform7
Raises the minimum Android SDK from 19 to 23.
Migrates to win32 version 5.5.4 to support Dart 3.4 / Flutter 3.22.0.
win32
Raises the minimum iOS version from 9 to 12.
Removes dart:io from the platform interface to support WASM builds of web.
dart:io
Updates all platforms to support Dart SDK <4.0.0.
Updates the minimum SDK according to Flutter requirements.
Requires a minimum Dart SDK of 3.3.0 and a minimum Flutter version of 3.19.0.
Deprecated4
Deprecates KeyCipherAlgorithm.RSA_ECB_PKCS1Padding; existing data migrates to RSA_ECB_OAEPwithSHA_256andMGF1Padding when migrateOnAlgorithmChange is true.
KeyCipherAlgorithm.RSA_ECB_PKCS1PaddingRSA_ECB_OAEPwithSHA_256andMGF1PaddingmigrateOnAlgorithmChange
Deprecates StorageCipherAlgorithm.AES_CBC_PKCS7Padding; existing data migrates to AES_GCM_NoPadding when migrateOnAlgorithmChange is true.
StorageCipherAlgorithm.AES_CBC_PKCS7PaddingAES_GCM_NoPaddingmigrateOnAlgorithmChange
Deprecates sharedPreferencesName in favor of storageNamespace, which provides complete isolation.
sharedPreferencesNamestorageNamespace
Deprecates AndroidOptions().encryptedSharedPreferences due to the Jetpack Crypto package deprecation.
AndroidOptionsencryptedSharedPreferences