hydrateFromJson static method
Parses a serialized JSON string and restores entries into the current scope.
Pure Dart and safe for SSR, VM, and browser environments.
// In client application bootstrap:
const jsonString = '{"queries": [...]}';
BloomData.hydrateFromJson(
jsonString,
deserialize: (json, key) => Todo.fromJson(json as Map<String, dynamic>),
);
See also:
- hydrate, to restore from an already-decoded Map.
- dehydrateToScriptTag, to generate the script tag during SSR.
Implementation
static void hydrateFromJson(
String jsonString, {
dynamic Function(dynamic json, List<dynamic> key)? deserialize,
}) =>
currentScope.hydrateFromJson(jsonString, deserialize: deserialize);