polygon property
ComponentDefinition<Polygon3DComponent>
get
polygon
Implementation
static ComponentDefinition<Polygon3DComponent> get polygon =>
_definition<Polygon3DComponent>(
type: 'Polygon3DComponent',
id: 'polygon_3d_54238989',
create: Polygon3DComponent.new,
name: 'Polygon',
description: 'An outline on the ground, raised to a height.',
icon: Icons.hexagon_outlined,
size: [
FieldDefinition(
name: 'points',
kind: FieldTypes.offsetList,
read: (c) => (c as Polygon3DComponent).points,
write: (c, v) => (c as Polygon3DComponent).points = (v as List)
.cast<Offset>()
.toList(),
),
_size<Polygon3DComponent>(
'height',
(c) => c.height,
(c, v) => c.height = v,
),
],
hints: const {
'points': FieldHint(
label: 'Points',
description:
'Its corners, in order round it: x and z on the ground.',
),
},
);