ui: make start button in calibration sheet fully circular

This commit is contained in:
2026-05-22 13:33:50 +02:00
parent 12772bcd8f
commit 5ae54f4fe9
+24 -4
View File
@@ -806,10 +806,12 @@ class _RingAreaState extends State<_RingArea> with TickerProviderStateMixin {
], ],
) )
else if (widget.onStart != null) else if (widget.onStart != null)
_AsyncButton( Positioned.fill(
onPressed: widget.onStart!, child: _AsyncButton(
label: 'Start', onPressed: widget.onStart!,
compact: true, label: 'Start',
circular: true,
),
), ),
], ],
), ),
@@ -952,6 +954,7 @@ class _AsyncButton extends StatefulWidget {
required this.label, required this.label,
this.icon, this.icon,
this.compact = false, this.compact = false,
this.circular = false,
this.enabled = true, this.enabled = true,
}); });
@@ -959,6 +962,7 @@ class _AsyncButton extends StatefulWidget {
final String label; final String label;
final IconData? icon; final IconData? icon;
final bool compact; final bool compact;
final bool circular;
final bool enabled; final bool enabled;
@override @override
@@ -992,6 +996,22 @@ class _AsyncButtonState extends State<_AsyncButton> {
final canPress = !_loading && widget.enabled; final canPress = !_loading && widget.enabled;
if (widget.circular) {
final cs = Theme.of(context).colorScheme;
return SizedBox.expand(
child: TextButton(
style: TextButton.styleFrom(
shape: const CircleBorder(),
foregroundColor: cs.primary,
overlayColor: cs.onSurface,
padding: EdgeInsets.zero,
),
onPressed: canPress ? _run : null,
child: child,
),
);
}
if (widget.compact) { if (widget.compact) {
return TextButton( return TextButton(
style: TextButton.styleFrom(shape: shape, textStyle: const TextStyle(fontSize: 36, color: Colors.black)), style: TextButton.styleFrom(shape: shape, textStyle: const TextStyle(fontSize: 36, color: Colors.black)),