build static method

Future<SecureHydratedStorage> build(
  1. dynamic secureStorage
)

Asynchronously pre-loads stored keys from secureStorage into memory, returning a fully initialized SecureHydratedStorage ready for synchronous frame 1 state hydration.

Implementation

static Future<SecureHydratedStorage> build(dynamic secureStorage) async {
  final dynamic rawAll = await secureStorage.readAll();
  final Map<String, String> all = Map<String, String>.from(
    (rawAll as Map).map((k, v) => MapEntry(k.toString(), v.toString())),
  );
  return SecureHydratedStorage._(secureStorage, all);
}