fromDynamic static method

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

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

See also:

  • ThemeDecoder.decodeAlignment

Implementation

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

  if (map != null) {
    result = JsonAlignBuilder(
      alignment: ThemeDecoder.decodeAlignment(
        map['alignment'],
        validate: false,
      ),
      heightFactor: JsonClass.maybeParseDouble(map['heightFactor']),
      widthFactor: JsonClass.maybeParseDouble(map['widthFactor']),
    );
  }

  return result;
}