flow update

This commit is contained in:
JMARyA 2024-09-26 21:01:45 +02:00
parent 4b2c8711df
commit a608c50447
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
2 changed files with 32 additions and 16 deletions

View file

@ -56,7 +56,7 @@ class _ActiveFlowPageState extends State<ActiveFlowPage> {
), ),
); );
if (confirm) { if (confirm ?? false) {
await API await API
.API() .API()
.endFlow(widget.flow.id) .endFlow(widget.flow.id)

View file

@ -65,26 +65,40 @@ class _CreateFlowPageState extends State<CreateFlowPage> {
}); });
} }
Widget buildInputSelection(BuildContext context) { List<Widget> buildInputSelection(BuildContext context) {
return Column( if (widget.info.depends.isEmpty) {
children: widget.info.depends.map((x) { return [];
return ElevatedButton( }
onPressed: () {
selectDependItems(context, x); return [
}, Column(
child: Text("Add $x")); children: widget.info.depends.map((x) {
}).toList()); return ElevatedButton(
onPressed: () {
selectDependItems(context, x);
},
child: Text("Add $x"));
}).toList()),
const Divider(),
];
} }
Widget flowContinuation() { Widget flowContinuation() {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Card( 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( 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( 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( body: Column(
children: [ children: [
if (widget.previousFlow != null) ...[ if (widget.previousFlow != null) ...[
flowContinuation(), flowContinuation(),
const Divider() const Divider()
], ],
buildInputSelection(context), ...buildInputSelection(context),
const Divider(),
Card( Card(
child: Column( child: Column(
children: depends children: depends