ImageItemContent.fromJson constructor

ImageItemContent.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ImageItemContent.fromJson(Map<String, dynamic> json) {
  return ImageItemContent(
    url: json['url'] != null ? asT<String>(json['url']) : null,
    assetName:
        json['assetName'] != null ? asT<String>(json['assetName']) : null,
    semanticLabel: json['semanticLabel'] != null
        ? asT<String>(json['semanticLabel'])
        : null,
    excludeFromSemantics:
        asNullT<bool>(json['excludeFromSemantics']) ?? false,
    width: json['width'] != null ? asT<double>(json['width']) : null,
    height: json['height'] != null ? asT<double>(json['height']) : null,
    color: json['color'] != null ? Color(asT<int>(json['color'])) : null,
    colorBlendMode: json['colorBlendMode'] != null
        ? BlendMode.values[asT<int>(json['colorBlendMode'])]
        : BlendMode.srcIn,
    fit: json['fit'] != null
        ? BoxFit.values[asT<int>(json['fit'])]
        : BoxFit.cover,
    repeat: json['repeat'] != null
        ? ImageRepeat.values[asT<int>(json['repeat'])]
        : ImageRepeat.noRepeat,
    matchTextDirection: asNullT<bool>(json['matchTextDirection']) ?? false,
    gaplessPlayback: asNullT<bool>(json['gaplessPlayback']) ?? false,
    isAntiAlias: asNullT<bool>(json['isAntiAlias']) ?? true,
    filterQuality: json['filterQuality'] != null
        ? FilterQuality.values[asT<int>(json['filterQuality'])]
        : FilterQuality.high,
  );
}