TextLayerManager class

文本图层管理器 负责管理所有文本图层的增删改查

Constructors

TextLayerManager()

Properties

count → int
获取图层数量
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasSelection → bool
检查是否有选中的图层
no setter
isEmpty → bool
检查是否有图层
no setter
layers → List<TextLayerData>
获取所有文本图层列表(按添加顺序)
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedLayer → TextLayerData?
获取选中的图层
no setter
selectedLayerId → String?
获取当前选中的图层ID
no setter

Methods

addLayer({required String text, required Offset position, Color color = Colors.blue, double fontSize = 32.0}) → String
添加文本图层
clear() → void
清空所有图层
clearSelection() → void
清除选择
copyLayers() → List<TextLayerData>
深拷贝所有图层(用于历史记录)
getDeleteButtonBounds(TextLayerData layer, Size canvasSize) → Rect
新增 获取删除按钮的边界框
getTextLayerBounds(TextLayerData layer, Size canvasSize) → Rect
获取文本图层的边界框
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeLayer(String id) → bool
删除指定的文本图层
removeSelectedLayer() → bool
删除当前选中的图层
restoreLayers(List<TextLayerData> layers) → void
恢复图层(用于历史记录)
selectLayer(String id) → bool
选择文本图层
selectLayerAt(Offset tapPosition, Size canvasSize) → String?
根据点击位置选择文本图层
toString() → String
A string representation of this object.
inherited
updateSelectedLayerColor(Color color) → bool
更新选中图层的颜色
updateSelectedLayerPosition(Offset position, Size canvasSize) → bool
更新选中图层的位置
updateSelectedLayerSize(double size) → bool
更新选中图层的大小

Operators

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