mirror of
https://github.com/foss42/apidash.git
synced 2025-05-20 07:46:32 +08:00
47 lines
1.0 KiB
Dart
47 lines
1.0 KiB
Dart
import 'package:apidash_design_system/apidash_design_system.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:apidash/consts.dart';
|
|
|
|
class SendButton extends StatelessWidget {
|
|
const SendButton({
|
|
super.key,
|
|
required this.isWorking,
|
|
required this.onTap,
|
|
this.onCancel,
|
|
});
|
|
|
|
final bool isWorking;
|
|
final void Function() onTap;
|
|
final void Function()? onCancel;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ADFilledButton(
|
|
onPressed: isWorking ? onCancel : onTap,
|
|
items: isWorking
|
|
? const [
|
|
Text(
|
|
kLabelCancel,
|
|
style: kTextStyleButton,
|
|
),
|
|
kHSpacer10,
|
|
Icon(
|
|
size: 16,
|
|
Icons.cancel,
|
|
)
|
|
]
|
|
: const [
|
|
Text(
|
|
kLabelSend,
|
|
style: kTextStyleButton,
|
|
),
|
|
kHSpacer10,
|
|
Icon(
|
|
size: 16,
|
|
Icons.send,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|