mirror of
https://github.com/block/buzz.git
synced 2026-10-28 21:11:48 +00:00
## What - add the shared desktop-style arc spinner for mobile - replace app loading indicators with the shared component - preserve a static pose when reduced motion is enabled ## Stack - follows #3313 ## Validation - `just mobile-check` - focused spinner and pairing widget tests --------- Signed-off-by: kenny lopez <klopez4212@gmail.com>
48 lines
1.2 KiB
Dart
48 lines
1.2 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: const CircleBorder(),
|
|
),
|
|
padding: EdgeInsets.zero,
|
|
icon: isSending
|
|
? BuzzLoadingIndicator(
|
|
size: 18,
|
|
color: context.colors.onPrimary,
|
|
semanticLabel: 'Sending message',
|
|
)
|
|
: Icon(
|
|
LucideIcons.arrowUp,
|
|
size: 18,
|
|
color: context.colors.onPrimary,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
String _formatUploadError(Object error) {
|
|
return error.toString().replaceFirst('Exception: ', '');
|
|
}
|