fromDynamic static method

JsonSaveContextBuilder? fromDynamic(
  1. dynamic map, {
  2. JsonWidgetRegistry? registry,
})

Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:

{
  "key": <String>
}

Where the value of the key attribute is the key used on the JsonWidgetRegistry.setValue to store the current BuildContext.

Implementation

static JsonSaveContextBuilder? fromDynamic(
  dynamic map, {
  JsonWidgetRegistry? registry,
}) {
  JsonSaveContextBuilder? result;

  if (map != null) {
    result = JsonSaveContextBuilder(key: map['key'] ?? 'context');
  }

  return result;
}