ShapeDefinition.labeled constructor
ShapeDefinition.labeled(
- String type, {
- required String name,
- String? text,
- ShapeOutline outline = const ShapeOutline.rect(),
- ShapeConnectionDefinition connection = const ShapeConnectionDefinition.outline(),
- DiagramSize size = const DiagramSize(160, 100),
- ShapeStyle style = const ShapeStyle(),
- double padding = 16,
- ParagraphAlignment alignment = ParagraphAlignment.center,
- ShapeBehavior behavior = const ShapeBehavior(),
- Map<
String, ValueField> values = const {},
A shape whose whole region is one padded, editable text slot
('label', initially text or name).
Implementation
factory ShapeDefinition.labeled(
String type, {
required String name,
String? text,
ShapeOutline outline = const ShapeOutline.rect(),
ShapeConnectionDefinition connection =
const ShapeConnectionDefinition.outline(),
DiagramSize size = const DiagramSize(160, 100),
ShapeStyle style = const ShapeStyle(),
double padding = 16,
ParagraphAlignment alignment = ParagraphAlignment.center,
ShapeBehavior behavior = const ShapeBehavior(),
Map<String, ValueField> values = const {},
}) => ShapeDefinition(
type: type,
name: name,
outline: outline,
connection: connection,
size: size,
style: style,
behavior: behavior,
values: values,
body: ShapeParts.labeled(
text ?? name,
padding: padding,
alignment: alignment,
),
);