QsImageView class
统一加载资源图片、SVG、网络图片和本地文件图片的组件。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- QsImageView
Constructors
-
QsImageView({Key? key, required QsImageType type, required String imageSrc, BoxFit fit = BoxFit.cover, Color? imageColor, Widget? placeholder, Widget? error, double? width, double? height, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, Color? backgroundColor, bool isCircle = false, bool isClipsToBounds = true, BorderRadiusGeometry? outerRadius, BorderRadiusGeometry? innerRadius, BoxBorder? border, List<
BoxShadow> ? boxShadows, Gradient? gradient, BoxConstraints? constraints, Rect? centerSlice}) -
创建一个图片组件。
const
Properties
- backgroundColor → Color?
-
图片容器背景颜色。
final
- border → BoxBorder?
-
图片容器边框。
final
-
boxShadows
→ List<
BoxShadow> ? -
图片容器阴影列表。
final
- centerSlice → Rect?
-
图片的九宫格拉伸区域,通常与
fit: BoxFit.fill配合使用。final - constraints → BoxConstraints?
-
图片容器的额外尺寸约束。
final
- error → Widget?
-
图片加载失败时显示的组件。
final
- fit → BoxFit
-
图片在可用空间内的填充方式。
final
- gradient → Gradient?
-
图片容器背景渐变。
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
图片容器高度。
final
- imageColor → Color?
-
叠加到图片上的颜色。
final
- imageSrc → String
-
图片资源路径、网络地址或本地文件路径。
final
- innerRadius → BorderRadiusGeometry?
-
图片内容的裁剪圆角。
final
- isCircle → bool
-
是否使用圆形外观。
final
- isClipsToBounds → bool
-
是否裁剪超出图片容器边界的内容。
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsetsGeometry?
-
图片容器外边距。
final
- outerRadius → BorderRadiusGeometry?
-
图片容器外层装饰圆角。
final
- padding → EdgeInsetsGeometry?
-
图片容器内边距。
final
- placeholder → Widget?
-
网络图片加载期间显示的占位组件。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → QsImageType
-
图片资源类型。
final
- width → double?
-
图片容器宽度。
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited