LuckyImagePlacement class final

图片的容器、尺寸和偏移解析规则;例如 placement.place(natural) 返回绘制矩形。

Annotations

Constructors

LuckyImagePlacement({required LuckyImageSlot slot, required LuckyImage image, required Rect box, required double maxWidth, required double maxHeight, required double leftBase, required double topBase, double yOffset = 0})
创建规则;各基准和 yOffset 均为逻辑像素。
const
LuckyImagePlacement.inRect({required LuckyImageSlot slot, required LuckyImage image, required Rect rect})
以 rect 为容器和百分比基准创建规则;例如卡片、格子内的图片。

Properties

box → Rect
容器矩形;宽零表示以 box.left 为水平中心。
final
hashCode → int
The hash code for this object.
no setterinherited
image → LuckyImage
图片项。
final
leftBase → double
水平偏移百分比基准。
final
maxHeight → double
高度百分比基准。
final
maxWidth → double
宽度百分比基准。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slot → LuckyImageSlot
图片槽。
final
topBase → double
顶部偏移百分比基准。
final
yOffset → double
附加纵向偏移。
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
place(Size natural) → Rect
用 natural 计算水平居中后叠加 left/top 偏移的绘制矩形。
toRequest({ImageProvider<Object>? provider}) → LuckyImageRequest
生成按本规则百分比基准解析解码尺寸的图片请求;provider 缺省用图片本身。
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited