encodeDecorationImage static method

Map<String, dynamic>? encodeDecorationImage(
  1. DecorationImage? value
)

Encodes the given value to a JSON representation.

{
  "alignment": <Alignment>,
  "centerSlice": <Rect>,
  "fit": <BoxFit>,
  "image": <ImageProvider>,
  "matchTextDirection": <bool>,
  "repeat": <ImageRepeat>,
  "scale": <double>
}

See also:

Implementation

static Map<String, dynamic>? encodeDecorationImage(DecorationImage? value) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = <String, dynamic>{
      'alignment': encodeAlignment(value.alignment as Alignment?),
      'centerSlice': encodeRect(value.centerSlice),
      'fit': encodeBoxFit(value.fit),
      'image': encodeImageProvider(value.image),
      'matchTextDirection': value.matchTextDirection,
      'repeat': encodeImageRepeat(value.repeat),
      'scale': value.scale,
    };
  }

  return result;
}