[feat] send multiple API requests in parallel

This commit is contained in:
Delwin Mathew
2024-03-01 12:22:52 +05:30
parent dc25c6a70e
commit 7dbe0b5d5f
5 changed files with 32 additions and 22 deletions

View File

@ -47,31 +47,26 @@ class CopyButton extends StatelessWidget {
class SendRequestButton extends StatelessWidget {
const SendRequestButton({
super.key,
required this.selectedId,
required this.sentRequestId,
required this.isWorking,
required this.onTap,
});
final String? selectedId;
final String? sentRequestId;
final bool? isWorking;
final void Function() onTap;
@override
Widget build(BuildContext context) {
bool disable = sentRequestId != null;
return FilledButton(
onPressed: disable ? null : onTap,
onPressed: isWorking == true ? null : onTap,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
disable
? (selectedId == sentRequestId ? kLabelSending : kLabelBusy)
: kLabelSend,
isWorking == true ? kLabelSending : kLabelSend,
style: kTextStyleButton,
),
if (!disable) kHSpacer10,
if (!disable)
if (isWorking == false) kHSpacer10,
if (isWorking == false)
const Icon(
size: 16,
Icons.send,