ui: make start button in calibration sheet fully circular
This commit is contained in:
@@ -806,10 +806,12 @@ class _RingAreaState extends State<_RingArea> with TickerProviderStateMixin {
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
else if (widget.onStart != null)
|
else if (widget.onStart != null)
|
||||||
_AsyncButton(
|
Positioned.fill(
|
||||||
|
child: _AsyncButton(
|
||||||
onPressed: widget.onStart!,
|
onPressed: widget.onStart!,
|
||||||
label: 'Start',
|
label: 'Start',
|
||||||
compact: true,
|
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)),
|
||||||
|
|||||||
Reference in New Issue
Block a user