Style.fromJson constructor

Style.fromJson(
  1. Map<String, dynamic> map
)

Implementation

Style.fromJson(Map<String, dynamic> map) {
  width = parseDimension(map["width"]);
  height = parseDimension(map["height"]);
  alignment = parseAlignment(map["alignment"]);

  margin = parseEdgeInsets(map["margin"]);
  padding = parseEdgeInsets(map["padding"]);

  visible = map["visible"];
  opacity = map["opacity"];
  backgroundDecoration = parseBoxDecoration(map["backgroundDecoration"]);
  foregroundDecoration = parseBoxDecoration(map["foregroundDecoration"]);

  shadows =
      (map["shadows"] as List?)?.map((e) => parseShapeShadow(e)!).toList();
  insetShadows = (map["insetShadows"] as List?)
      ?.map((e) => parseShapeShadow(e)!)
      .toList();

  shapeBorder = parseMorphableShapeBorder(map["shapeBorder"]);

  transform = parseSmoothMatrix4(map["transform"]);
  transformAlignment = parseAlignment(map["transformAlignment"]);

  childAlignment = parseAlignment(map["childAlignment"]);

  textAlign = parseTextAlign(map["textAlign"]);
  textStyle = parseDynamicTextStyle(map["textStyle"]);

  shaderGradient = parseGradient(map["shaderGradient"]);
  imageFilter = parseImageFilter(map['imageFilter']);
  backdropFilter = parseImageFilter(map['backdropFilter']);

  mouseCursor = parseSystemMouseCursor(map["mouseCursor"]);
}