diagram_editor 0.0.2 copy "diagram_editor: ^0.0.2" to clipboard
diagram_editor: ^0.0.2 copied to clipboard

outdated

A flutter diagram editor library that provides DiagramEditor widget and a possibility to customize all editor design and behavior.

diagram_editor #

pub package

Github

Flutter diagram editor library for showing and editing diagrams of custom type. It provides DiagramEditor widget and a possibility to customize all editor design and behavior.

Demo App Example (example source code)

Getting Started #

Simple example of this package usage is in /example folder.

Use of DiagramEditor widget:

DiagramEditor(
  diagramEditorContext: DiagramEditorContext(
    policySet: myPolicySet,
  ),
),

myPolicySet is a class composed of mixins, for example:

class MyPolicySet extends PolicySet
    with
        MyInitPolicy,
        CanvasControlPolicy,
        LinkControlPolicy,
        LinkJointControlPolicy,
        LinkAttachmentRectPolicy {}

MyInitpolicy can be following:

mixin MyInitPolicy implements InitPolicy {
  @override
  initializeDiagramEditor() {
    canvasWriter.state.setCanvasColor(Colors.grey[300]);
  }
}

There are several editor policies that can be implemented and added to policy set:

  • InitPolicy
  • CanvasPolicy
  • ComponentPolicy
  • ComponentDesignPolicy
  • LinkPolicy
  • LinkJointPolicy
  • LinkAttachmentPolicy
  • LinkWidgetsPolicy
  • CanvasWidgetsPolicy
  • ComponentWidgetsPolicy

Some policies are already implemented and ready to use:

  • CanvasControlPolicy
  • LinkControlPolicy
  • LinkJointControlPolicy
  • LinkAttachmentRectPolicy

More in examples (links above).

153
likes
0
pub points
85%
popularity

Publisher

unverified uploader

A flutter diagram editor library that provides DiagramEditor widget and a possibility to customize all editor design and behavior.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, provider, uuid

More

Packages that depend on diagram_editor