blueprint_system 0.1.2 blueprint_system: ^0.1.2 copied to clipboard
A flutter library that creates blueprint widgets with nodes (child widgets) that may be added to them. These nodes can be moved, resized, and modified.
Blueprint System
A Flutter library that creates blueprint widgets with nodes (child widgets) that may be added to them. These nodes can be moved, resized, and modified.
Explore the docs ยป
View Example ยท Report Bug ยท Request FeatureGetting Started #
Installation #
-
Method 1 (Recommended)
run this line in your terminal:
flutter pub add blueprint_system
-
Method 2
add this line to your
pubspec.yaml
dependencies:dependencies: blueprint_system: 0.1.2
then get packages, (Alternatively, your editor might support this)
flutter pub get
Quick Implementation #
-
Method 1 (using children)
Blueprint( children: [ FloatingNode( initPosition: Offset(300, 500), initSize: const Size(200, 100), child: (c) => Container( color: Colors.blue, ), ), ], );
-
Method 2 (using a controller)
-
Initialize controller and assign it to Blueprint widget
BlueprintController controller = BlueprintController.instance @override Widget build(BuildContext context) { return Scaffold( body: Blueprint(controller: controller), ); }
-
Control your blueprint anywhere in the project
DraggableNode node = DraggableNode( initPosition: const Offset(50, 100), // optional, default is (100, 100) initSize: const Size(200, 100), // optional, default is (100, 100) child: (c) => Container( color: Colors.red, child: Text(c.position.toString()), ), ); // add node(s) controller.addNode(node); // or controller.addNodes([node1, node2, ...]);
-
Learn More #
- More info: Explore the docs
- See: Full Example
Known Issues #
-
Transferring a DraggableNode from a Blueprint to another.
Explanation: When dragging and dropping a DraggableNode in another Blueprint, a new node is created in the second Blueprint with the same values (different id of course.), and simply removing the old DraggableNode from the first Blueprint, could make it lost in both blueprints forever if the transferring operation failed. So I need to think about a better solution for this.
Track this issue here #2
Additional Information #
This package is still under development ๐ง and I will do my best to make it more stable.
If you encounter any bugs, please file an issue and I will try to fix them as soon as possible.
Pull requests are always welcome! ๐ฆ
// TODO: #
- โ Fixed Node ๐
- โ Draggable Node ๐โ๏ธ
- โ Floating Node โจ
- โ Blueprint rulers ๐
- โ Add the ability to resize nodes (visually not programmatically).
- โ Connecting Nodes using arrows (like the flow chart).
- โ Blueprint (Export to / Import from) JSON, YAML, XML, etc.
- โ Blueprint Themes/Templates.
- โ https://github.com/salah-rashad/blueprint_system/issues/2
- โ Add an option to make the
FloatingNode
responsive to screen size changes.