Skip to content

DecorationImage

An image for a box decoration.

属性 ​

名称类型默认值说明
srcOptional[Union[str, bytes]]NoneThe image source to paint. Accepts URLs, asset paths, base64 strings (with or without data: prefixes), or raw bytes.
color_filterOptional[ColorFilter]NoneA color filter to apply to the image before painting it.
fitOptional[BoxFit]NoneHow the image should be inscribed into the box.
alignmentAlignmentAlignment.CENTER()The alignment of the image within its bounds.
repeatImageRepeatImageRepeat.NO_REPEATHow the image should be repeated to fill the box.
match_text_directionboolFalseWhether to paint the image in the direction of the TextDirection.
scaleNumber1.0The scale(image pixels to be shown per logical pixels) to apply to the image.
opacityNumber1.0The opacity of the image.
filter_qualityFilterQualityFilterQuality.MEDIUMThe quality of the image filter.
invert_colorsboolFalseWhether to invert the colors of the image while drawing.
anti_aliasboolFalseWhether to paint the image in anti-aliased quality.

方法 ​

名称类型默认值说明
copy'DecorationImage'—返回此对象的副本,可覆盖指定属性。

关注我,学习大模型、大数据、Python等热门技术。