FreeHexagon class
自由布局的六边形配置
Constructors
-
FreeHexagon({required String id, required Offset center, required double size, HexOrientation orientation = HexOrientation.flat, double rotation = 0.0, Map<
String, dynamic> data = const {}}) -
const
Properties
- center → Offset
-
中心点位置(像素坐标)
final
-
data
→ Map<
String, dynamic> -
自定义数据
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
唯一标识
final
- orientation → HexOrientation
-
方向(尖顶朝上或平顶朝上)
final
- rotation → double
-
旋转角度(弧度)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → double
-
六边形大小(半径)
final
Methods
-
copyWith(
{String? id, Offset? center, double? size, HexOrientation? orientation, double? rotation, Map< String, dynamic> ? data}) → FreeHexagon - 复制并修改属性
-
getCorners(
) → List< Offset> - 获取六边形的所有顶点坐标
-
getEdgeLength(
) → double - 获取边的长度
-
getEdgeMidpoint(
int edgeIndex) → Offset - 获取指定边的中点(0-5)
-
getEdgeNormal(
int edgeIndex) → Offset - 获取指定边的法向量(指向外侧)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override