fromDynamic static method

JsonDynamicBuilder 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:

{
  "dynamic" : {
    "builderType": "<String>",
    "childTemplate": "<Object>",
    "initState": "<List>"
  }
}

See also:

Implementation

static JsonDynamicBuilder fromDynamic(
  dynamic map, {
  JsonWidgetRegistry? registry,
}) {
  final result = maybeFromDynamic(
    map,
    registry: registry,
  );

  if (result == null) {
    throw Exception(
      '[JsonDynamicBuilder]: requested to parse from dynamic, but the input is null.',
    );
  }

  return result;
}