From 5ae54f4fe9c4175658591a8f61d6139501768940 Mon Sep 17 00:00:00 2001 From: dvdrw Date: Fri, 22 May 2026 13:33:50 +0200 Subject: [PATCH] ui: make start button in calibration sheet fully circular --- lib/features/sensors/calibration_sheet.dart | 28 ++++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/features/sensors/calibration_sheet.dart b/lib/features/sensors/calibration_sheet.dart index 1657dc8..e261a5a 100644 --- a/lib/features/sensors/calibration_sheet.dart +++ b/lib/features/sensors/calibration_sheet.dart @@ -806,10 +806,12 @@ class _RingAreaState extends State<_RingArea> with TickerProviderStateMixin { ], ) else if (widget.onStart != null) - _AsyncButton( - onPressed: widget.onStart!, - label: 'Start', - compact: true, + Positioned.fill( + child: _AsyncButton( + onPressed: widget.onStart!, + label: 'Start', + circular: true, + ), ), ], ), @@ -952,6 +954,7 @@ class _AsyncButton extends StatefulWidget { required this.label, this.icon, this.compact = false, + this.circular = false, this.enabled = true, }); @@ -959,6 +962,7 @@ class _AsyncButton extends StatefulWidget { final String label; final IconData? icon; final bool compact; + final bool circular; final bool enabled; @override @@ -992,6 +996,22 @@ class _AsyncButtonState extends State<_AsyncButton> { 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) { return TextButton( style: TextButton.styleFrom(shape: shape, textStyle: const TextStyle(fontSize: 36, color: Colors.black)),