Skip to content

marcotrumpet/diagrams

Repository files navigation

Diagrams

This is a test project to play around with CustomPainter and an excuse to test Flutter Web and Flutter Desktop.

The main idea is to basically rewrite draw.io as close as possible. In this way I can explore and learn new stuff.

Goals

  • Have a set of basic shapes
  • Draw arrows to link shapes (after many iteration I tryed to adapt this A* algorithm to my needs)
  • Change arrow path
  • Change elements dimensions
  • Textfields inside elements
  • Change elements properties (color, border, background)
  • Change text properties
  • Many, many, more

Examples

This first image is the empty grid when app starts:
drawing

When you add elements you can link them with arrows, the A* algorithm takes care of finding the shortest path:
drawing

When you add elements that cross arrows, the A* algorithm takes care of finding the shortest path avoiding collision with element not linked to the arrow:
drawing

Tests

To manually run test use:

To run bloc tests flutter test test/bloc_test.dart
To run unit tests flutter test test/unit_test.dart
To run golden tests flutter test test/golden_test.dart --tags=golden
To update golden tests flutter test test/golden_test.dart --update-goldens --tags=golden

Inside .githooks folder there are a pre-commit script that performs formatter and analyzer and a pre-push script that runs tests and the coverage command.

If you are on vscode, in order to get the test coverage, you need to install flutter coverage and coverage-gutters.

There is also a flutter_test.yml intended to be used inside github actions that will perform tests on pull requests.

Localization

Run flutter pub run fast_i18n to re-generate keys corresponding to json labels in lib/i18n.

About

An app that let you draw diagrams.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published