This commit is contained in:
JMARyA 2024-09-24 15:59:16 +02:00
parent 4a93adf463
commit 2cd3e589db
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -370,6 +370,19 @@ class TransactionSelectPage extends StatelessWidget {
}
}
class EndFlowWithProduce extends StatelessWidget {
final API.Flow flow;
final API.FlowInfo info;
const EndFlowWithProduce(this.flow, this.info, {super.key});
@override
Widget build(BuildContext context) {
// todo : show end screen with produce
return Scaffold();
}
}
class ActiveFlowPage extends StatelessWidget {
final API.Flow flow;
final API.FlowInfo info;
@ -382,12 +395,11 @@ class ActiveFlowPage extends StatelessWidget {
appBar: AppBar(
title: Text(info.name),
actions: [
// todo : end flow
IconButton(
onPressed: () async {
if (info.produces?.isNotEmpty ?? false) {
// todo : show end screen with produce
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => EndFlowWithProduce(flow, info)));
return;
}
@ -396,7 +408,7 @@ class ActiveFlowPage extends StatelessWidget {
context: context,
builder: (context) => AlertDialog(
title: const Text('Are you sure?'),
content: const Text('This will delete the flow.'),
content: const Text('This will end the flow.'),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
@ -404,7 +416,7 @@ class ActiveFlowPage extends StatelessWidget {
),
ElevatedButton(
onPressed: () => Navigator.of(context).pop(true),
child: const Text('Delete'),
child: const Text('End'),
),
],
),