diff --git a/lib/pages/flow/active_flow_page.dart b/lib/pages/flow/active_flow_page.dart index d1f963e..33e9388 100644 --- a/lib/pages/flow/active_flow_page.dart +++ b/lib/pages/flow/active_flow_page.dart @@ -56,7 +56,7 @@ class _ActiveFlowPageState extends State { ), ); - if (confirm) { + if (confirm ?? false) { await API .API() .endFlow(widget.flow.id) diff --git a/lib/pages/flow/create_flow_page.dart b/lib/pages/flow/create_flow_page.dart index 2d66a66..eb9ce91 100644 --- a/lib/pages/flow/create_flow_page.dart +++ b/lib/pages/flow/create_flow_page.dart @@ -65,26 +65,40 @@ class _CreateFlowPageState extends State { }); } - Widget buildInputSelection(BuildContext context) { - return Column( - children: widget.info.depends.map((x) { - return ElevatedButton( - onPressed: () { - selectDependItems(context, x); - }, - child: Text("Add $x")); - }).toList()); + List buildInputSelection(BuildContext context) { + if (widget.info.depends.isEmpty) { + return []; + } + + return [ + Column( + children: widget.info.depends.map((x) { + return ElevatedButton( + onPressed: () { + selectDependItems(context, x); + }, + child: Text("Add $x")); + }).toList()), + const Divider(), + ]; } Widget flowContinuation() { return Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Card( - child: Text(widget.previousFlow!.kind), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(widget.previousFlow!.kind), + ), ), - const Text(" -> "), + Card(child: Icon(Icons.arrow_right)), Card( - child: Text(widget.info.name), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(widget.info.name), + ), ) ], ); @@ -93,15 +107,17 @@ class _CreateFlowPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar(title: Text("Create new ${widget.info.name} Flow")), + appBar: AppBar( + title: Text(widget.previousFlow != null + ? "Continue to ${widget.previousFlow!.kind}" + : "Create new ${widget.info.name} Flow")), body: Column( children: [ if (widget.previousFlow != null) ...[ flowContinuation(), const Divider() ], - buildInputSelection(context), - const Divider(), + ...buildInputSelection(context), Card( child: Column( children: depends