Arokip / flutter_diagram_editor

Fllutter diagram editor library
MIT License
116 stars 38 forks source link

some changes to serialization #32

Closed ProZhar closed 4 months ago

ProZhar commented 2 years ago

Hi. For now, it has two options of serialization:

  1. Serialize to String as you implemented
  2. Serialize to Object with access to DiagramData class and 3 options with storage serialized data.

Why it needed? Because in case 1 (serialize to String with serializeStringDiagram() method) and saved option 3 (data stored as child in ParentData class) we have a problem with readable file:

So if we use the getDiagram() method, we can solve this problem. We will also have more options for programmatically creating a diagram data (case 2 : serialize to Object with serializeObjectDiagram(), option 3 (data stored as child in ParentData class): -it looks more readable: 2