fromJson method

  1. @override
BoxDecoration? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
BoxDecoration? fromJson(Map<String, dynamic>? json) {
  if (json == null) return null;

  return BoxDecoration(
    backgroundBlendMode: const NullableBlendModeConverter().fromJson(
      json['backgroundBlendMode'],
    ),
    border: const NullableBoxBorderConverter().fromJson(
      json['border'],
    ),
    borderRadius: const NullableBorderRadiusConverter().fromJson(
      json['borderRadius'],
    ),
    boxShadow: _decodeDynamicList(
      json['boxShadow'],
      (json) => const NullableBoxShadowConverter().fromJson(json)!,
    ),
    color: const NullableColorConverter().fromJson(
      json['color'],
    ),
    gradient: const NullableGradientConverter().fromJson(
      json['gradient'],
    ),
    image: const NullableDecorationImageConverter().fromJson(
      json['image'],
    ),
    shape: const NullableBoxShapeConverter().fromJson(
          json['shape'],
        ) ??
        BoxShape.rectangle,
  );
}