fix: segment button icons

This commit is contained in:
DenserMeerkat
2024-07-04 16:24:53 +05:30
parent 3f17840361
commit 9eeaf7e498

View File

@ -425,13 +425,8 @@ class _BodySuccessState extends State<BodySuccess> {
(widget.options == kRawBodyViewOptions) (widget.options == kRawBodyViewOptions)
? const SizedBox() ? const SizedBox()
: SegmentedButton<ResponseBodyView>( : SegmentedButton<ResponseBodyView>(
showSelectedIcon: showLabel, style: SegmentedButton.styleFrom(
style: const ButtonStyle( padding: const EdgeInsets.symmetric(horizontal: 8),
padding: WidgetStatePropertyAll(
EdgeInsets.symmetric(
horizontal: 8,
),
),
), ),
selectedIcon: Icon(currentSeg.icon), selectedIcon: Icon(currentSeg.icon),
segments: widget.options segments: widget.options
@ -439,7 +434,10 @@ class _BodySuccessState extends State<BodySuccess> {
(e) => ButtonSegment<ResponseBodyView>( (e) => ButtonSegment<ResponseBodyView>(
value: e, value: e,
label: Text(e.label), label: Text(e.label),
icon: showLabel ? Icon(e.icon) : null, icon: constraints.maxWidth >
kMinWindowSize.width
? Icon(e.icon)
: null,
), ),
) )
.toList(), .toList(),