sodium_libs
⚠️ THIS PACKAGE IS DEPRECATED
Due to recent advancements in how dart handles native assets (more concrete the build hooks), this library is no longer required to usesodiumin flutter applications.The replacement is straightforward: Simply reference
sodiumdirectly in yourpubspec.yamlinstead ofsodium_libs. The build hooks will take care of the rest.See sodium README for more details and check out the migration guide below for a step-by-step guide on how to transition from
sodium_libstosodium.
Migrating to sodium
The migration is relatively easy, as the API of sodium remains unchanged. The main change is in how you reference the
library.
- Replace the dependency in your
pubspec.yaml:
withdependencies: sodium_libs: ^<latest_version>dependencies: sodium: ^<latest_version> - Update all imports to reference
sodiuminstead ofsodium_libs:
should be changed toimport 'package:sodium_libs/sodium_libs.dart';import 'package:sodium/sodium.dart'; - Run
flutter cleanand thenflutter pub getto ensure no old build artifacts are causing any issues.
And thats it! Your application should now be using sodium directly, and you can take advantage of the latest features
and improvements without needing the sodium_libs package anymore.