File tree Expand file tree Collapse file tree 4 files changed +30
-2
lines changed
Expand file tree Collapse file tree 4 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ export 'src/workflow/input.dart' show WorkflowInput;
99export 'src/workflow/output.dart' show WorkflowOutput;
1010export 'src/workflow/model.dart' show WorkflowModel;
1111export 'src/workflow/view.dart' show WorkflowView;
12+ export 'src/workflow/view/node.dart' show WorkflowViewNode;
Original file line number Diff line number Diff line change @@ -42,4 +42,14 @@ class Workflow{
4242 version
4343 );
4444 }
45+
46+ Workflow .fromEmpty () :
47+ lastNodeId = 0 ,
48+ lastLinkId = 0 ,
49+ nodes = < WorkflowNode > [],
50+ links = < dynamic > {},
51+ groups = < dynamic > [],
52+ config = {},
53+ extra = {},
54+ version = '0.0.1' ;
4555}
Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
2- import '../workflow/model.dart' ;
2+ import 'model.dart' ;
3+ import 'view/node.dart' ;
34
45class WorkflowView extends StatelessWidget {
56
@@ -12,7 +13,7 @@ class WorkflowView extends StatelessWidget {
1213 return Column (
1314 children: [
1415 Stack (
15- children: workflow.nodes.map <Text >((item) => Text (item.type )).toList ()
16+ children: workflow.nodes.map <WorkflowViewNode >((item) => WorkflowViewNode (item)).toList ()
1617 ),
1718 TextButton (
1819 onPressed: () => workflow.loadExample (),
Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+ import '../node.dart' ;
3+
4+ class WorkflowViewNode extends StatelessWidget {
5+ const WorkflowViewNode (this .node, {super .key});
6+
7+ final WorkflowNode node;
8+
9+ @override
10+ Widget build (BuildContext context) {
11+ return Padding (
12+ padding: const EdgeInsets .all (8.0 ),
13+ child: Text (node.type),
14+ );
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments