flow update
This commit is contained in:
parent
4b2c8711df
commit
a608c50447
2 changed files with 32 additions and 16 deletions
|
@ -56,7 +56,7 @@ class _ActiveFlowPageState extends State<ActiveFlowPage> {
|
|||
),
|
||||
);
|
||||
|
||||
if (confirm) {
|
||||
if (confirm ?? false) {
|
||||
await API
|
||||
.API()
|
||||
.endFlow(widget.flow.id)
|
||||
|
|
|
@ -65,26 +65,40 @@ class _CreateFlowPageState extends State<CreateFlowPage> {
|
|||
});
|
||||
}
|
||||
|
||||
Widget buildInputSelection(BuildContext context) {
|
||||
return Column(
|
||||
children: widget.info.depends.map((x) {
|
||||
return ElevatedButton(
|
||||
onPressed: () {
|
||||
selectDependItems(context, x);
|
||||
},
|
||||
child: Text("Add $x"));
|
||||
}).toList());
|
||||
List<Widget> 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<CreateFlowPage> {
|
|||
@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
|
||||
|
|
Loading…
Reference in a new issue