fromDynamic static method

JsonCenterBuilder? 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:

{
  "heightFactor": <double>,
  "widthFactor": <double>
}

Implementation

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

  if (map != null) {
    result = JsonCenterBuilder(
      heightFactor: JsonClass.parseDouble(map['heightFactor']),
      widthFactor: JsonClass.parseDouble(map['widthFactor']),
    );
  }

  return result;
}