fromJson method

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

Implementation

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

  return DecorationImage(
    alignment:
        const NullableAlignmentConverter().fromJson(json['alignment']) ??
            Alignment.center,
    centerSlice: const NullableRectConverter().fromJson(json['centerSlice']),
    // @unencodable
    // colorFilter
    fit: const NullableBoxFitConverter().fromJson(json['fit']),
    image: const NullableImageProviderConverter().fromJson(json['image'])!,
    matchTextDirection: (json['matchTextDirection'] as bool),
    repeat: const NullableImageRepeatConverter().fromJson(json['repeat']) ??
        ImageRepeat.noRepeat,
    scale: ((json['scale'] ?? 1.0) as num).toDouble(),
  );
}