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.

example/main.dart

import 'package:diagram_editor/diagram_editor.dart';

import 'package:flutter/material.dart';

import 'my_policy_set.dart';

void main() => runApp(DiagramApp());

class DiagramApp extends StatefulWidget {
  @override
  _DiagramAppState createState() => _DiagramAppState();
}

class _DiagramAppState extends State<DiagramApp> {
  MyPolicySet myPolicySet = MyPolicySet();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Stack(
            children: [
              Container(color: Colors.grey),
              Padding(
                padding: EdgeInsets.all(16),
                child: Container(
                  color: Colors.green,
                  child: DiagramEditor(
                    diagramEditorContext: DiagramEditorContext(
                      policySet: myPolicySet,
                    ),
                  ),
                ),
              ),
              GestureDetector(
                onTap: () => myPolicySet.deleteAllComponents(),
                child: Container(
                  width: 64,
                  height: 32,
                  color: Colors.red,
                  child: Center(child: Text('delete all')),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
154
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