DiagramFlutterExtension class
An extension with Flutter contributions, installed like any other in the
controller's extensions; a mounted DiagramCanvas uses the installed
Flutter extensions.
Beside the portable contributions of DiagramExtension, it contributes any of: a container around the canvas, key shortcuts that perform installed verbs, shape widgets, effects, inspector propertyEditors, a paste handler, canvas behavior through createBehavior, a move adjuster through createMoveAdjuster and a viewport overlay through build. Its own settings, such as colors, belong in its options. An editable extension, such as the editor, makes the canvas edit; without one the canvas navigates and selects only. It observes the canvas and edits through the controller of its DiagramCanvasExtensionHost; it never owns document state.
final class BadgesExtension extends DiagramFlutterExtension {
const BadgesExtension() : super(id: 'example.badges');
@override
Widget build(BuildContext context, DiagramCanvasExtensionHost host) =>
Observer(builder: (_) => Badges(host.controller.scene));
}
- Inheritance
-
- Object
- DiagramExtension
- DiagramFlutterExtension
- Implementers
Constructors
-
DiagramFlutterExtension({required String id, List<
DiagramExtension> dependencies = const [], List<ShapeDefinition> shapes = const [], List<DiagramTextDefinition> textTypes = const [], List<DiagramConnectorDefinition> connectors = const [], List<DiagramConnectorRouteProvider> routes = const [], List<DiagramArrowheadDefinition> arrowheads = const [], List<DiagramPortShapeDefinition> portShapes = const [], List<DiagramContentDefinition> contents = const [], List<DiagramVerb> verbs = const [], List<DiagramToolDefinition> tools = const [], List<GraphLayoutAlgorithm< graphLayouts = const [], List<Layout> >DiagramDiagnosticRule> diagnostics = const [], List<DiagramTool> ? palette, Object? options, DiagramTextLayoutEngine? textLayout, DiagramOutput? output, bool editable = false, DiagramCanvasContainerBuilder? container, List<DiagramKeyBinding> shortcuts = const [], Map<String, ShapeWidgetBuilder> widgets = const {}, List<EffectDefinition> effects = const [], List<DiagramPropertyEditor> propertyEditors = const [], DiagramPasteHandler? paste}) -
const
Properties
-
arrowheads
→ List<
DiagramArrowheadDefinition> -
finalinherited
-
connectors
→ List<
DiagramConnectorDefinition> -
finalinherited
- container → DiagramCanvasContainerBuilder?
-
Wraps the canvas; the first installed container is innermost.
final
-
contents
→ List<
DiagramContentDefinition> -
Structured content, such as tables, that shapes place in content layers.
finalinherited
-
dependencies
→ List<
DiagramExtension> -
Extensions this one needs, installed with these defaults unless the
application installs an extension with the same id.
finalinherited
-
diagnostics
→ List<
DiagramDiagnosticRule> -
Checks run on demand by DiagramController.checkDiagnostics.
finalinherited
- editable → bool
-
Whether this extension makes the canvas edit: tools, gestures and text
input. The editor is editable.
final
-
effects
→ List<
EffectDefinition> -
final
-
graphLayouts
→ List<
GraphLayoutAlgorithm< Layout> > -
Graph layout algorithms, one per Layout type.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique among installed extensions, namespaced like
vyuh.table.finalinherited - options → Object?
-
This extension's initial options, keyed by their Dart type.
finalinherited
- output → DiagramOutput?
-
SVG and PNG output. At most one installed extension supplies it; a
mounted canvas supplies its own otherwise.
finalinherited
-
palette
→ List<
DiagramTool> ? -
The tools a controller offers, in order, or null. At most one installed
extension declares a palette; without one, every installed tool the
grammar supports is offered.
finalinherited
- paste → DiagramPasteHandler?
-
Handles external text pasted on the canvas, or null.
final
-
portShapes
→ List<
DiagramPortShapeDefinition> -
Port marker geometry, keyed by PortShape.
finalinherited
-
propertyEditors
→ List<
DiagramPropertyEditor> -
Inspector controls for this extension's custom properties.
final
-
routes
→ List<
DiagramConnectorRouteProvider> -
Route algorithms any connector may select by route name.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shapes
→ List<
ShapeDefinition> -
finalinherited
-
shortcuts
→ List<
DiagramKeyBinding> -
final
- textLayout → DiagramTextLayoutEngine?
-
Text shaping for the diagram, such as a native server backend. At most
one installed extension supplies it; a mounted canvas supplies its own
otherwise.
finalinherited
-
textTypes
→ List<
DiagramTextDefinition> -
Text types, such as rich text, that shape slots and connector labels
may use by definition. Each is also a type of the core's standalone
text element, whose element type is the text type's name.
finalinherited
-
tools
→ List<
DiagramToolDefinition> -
finalinherited
-
verbs
→ List<
DiagramVerb> -
Element and diagram verbs this extension adds. Verbs that belong to one
shape or part are declared on its definition instead.
finalinherited
-
widgets
→ Map<
String, ShapeWidgetBuilder> -
final
Methods
-
build(
BuildContext context, DiagramCanvasExtensionHost host) → Widget -
A viewport overlay, such as a minimap. Observe the host's controller and
canvas state inside an
Observer. -
createBehavior(
DiagramCanvasExtensionHost host) → DiagramCanvasBehavior? - Behavior in the canvas's input pipeline while it edits, or null.
-
createMoveAdjuster(
DiagramController controller) → DiagramMoveAdjuster? -
Adjusts selection moves on the canvas of
controller, such as snapping them into alignment, or null. Created when the canvas mounts; adjusters apply in installation order and the host shows their DiagramCanvasExtensionHost.moveGuides. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
propertiesFor(
DiagramPropertyScope scope) → Iterable< DiagramProperty< Object?, Object?> > -
Property panel entries this extension contributes, such as its
options while the canvas is inspected.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited