encodeDecorationImage static method
Encodes the given value
to a JSON representation.
{
"alignment": "<Alignment>",
"centerSlice": "<Rect>",
"filterQuality": "<FilterQuality>",
"fit": "<BoxFit>",
"image": "<ImageProvider>",
"invertColors": "<bool>",
"isAntiAlias": "<bool>",
"matchTextDirection": "<bool>",
"opacity": "<double>",
"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': encodeAlignmentGeometry(value.alignment),
'centerSlice': encodeRect(value.centerSlice),
'filterQuality': encodeFilterQuality(value.filterQuality),
'fit': encodeBoxFit(value.fit),
'image': encodeImageProvider(value.image),
'invertColors': value.invertColors,
'isAntiAlias': value.isAntiAlias,
'matchTextDirection': value.matchTextDirection,
'opacity': value.opacity,
'repeat': encodeImageRepeat(value.repeat),
'scale': value.scale,
};
}
return _stripNull(result);
}