mirror of
https://github.com/foss42/apidash.git
synced 2025-05-31 06:08:09 +08:00
[feat] send multiple API requests in parallel
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user