decorationImageFromJSON function

DecorationImage? decorationImageFromJSON(
  1. ThemeData theme,
  2. dynamic json,
  3. PageArgsModel? pageArgs
)

Implementation

DecorationImage? decorationImageFromJSON(
    ThemeData theme, dynamic json, PageArgsModel? pageArgs) {
  if (json == null) {
    return null;
  }
  var src = json["src"];
  var srcBase64 = json["src_base64"];
  ImageProvider? image = getImageProvider(src, srcBase64, pageArgs);
  if (image == null) {
    return null;
  }
  return DecorationImage(
    image: image,
    colorFilter: colorFilterFromJSON(json["color_filter"], theme),
    fit: parseBoxFit(json["fit"]),
    alignment: alignmentFromJson(json["alignment"], Alignment.center)!,
    repeat: parseImageRepeat(json["repeat"], ImageRepeat.noRepeat)!,
    matchTextDirection: parseBool(json["match_text_direction"], false)!,
    scale: parseDouble(json["scale"], 1.0)!,
    opacity: parseDouble(json["opacity"], 1.0)!,
    filterQuality:
        parseFilterQuality(json["filter_quality"], FilterQuality.medium)!,
    invertColors: parseBool(json["invert_colors"], false)!,
    isAntiAlias: parseBool(json["anti_alias"], false)!,
  );
}