initFromSodiumJS static method

Future<Sodium> initFromSodiumJS(
  1. FutureOr<LibSodiumJS> getLibsodium()
)

Creates a Sodium instance for the loaded libsodium returned by the callback as LibSodiumJS.

The getLibsodium parameter must be a factory method that returns a loaded sodium.js. Please refer to the README for more details on loading the library.

Implementation

static Future<Sodium> initFromSodiumJS(
  FutureOr<LibSodiumJS> Function() getLibsodium,
) async =>
    SodiumJS(await getLibsodium());