mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
53 lines
1.3 KiB
Dart
53 lines
1.3 KiB
Dart
part of '../compose_bar.dart';
|
|
|
|
class _SendButton extends StatelessWidget {
|
|
final bool isSending;
|
|
final bool isDisabled;
|
|
final VoidCallback onTap;
|
|
|
|
const _SendButton({
|
|
required this.isSending,
|
|
required this.onTap,
|
|
this.isDisabled = false,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SizedBox(
|
|
width: 36,
|
|
height: 36,
|
|
child: IconButton(
|
|
onPressed: (isSending || isDisabled) ? null : onTap,
|
|
style: IconButton.styleFrom(
|
|
backgroundColor: context.colors.primary,
|
|
disabledBackgroundColor: context.colors.primary.withValues(
|
|
alpha: 0.5,
|
|
),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(Radii.md),
|
|
),
|
|
),
|
|
padding: EdgeInsets.zero,
|
|
icon: isSending
|
|
? SizedBox(
|
|
width: 16,
|
|
height: 16,
|
|
child: CircularProgressIndicator(
|
|
strokeWidth: 2,
|
|
color: context.colors.onPrimary,
|
|
),
|
|
)
|
|
: Icon(
|
|
LucideIcons.sendHorizontal,
|
|
size: 18,
|
|
color: context.colors.onPrimary,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
String _formatUploadError(Object error) {
|
|
return error.toString().replaceFirst('Exception: ', '');
|
|
}
|