From 9eeaf7e498797cd6f5f930eeacc23c6ece91d2c8 Mon Sep 17 00:00:00 2001 From: DenserMeerkat Date: Thu, 4 Jul 2024 16:24:53 +0530 Subject: [PATCH] fix: segment button icons --- lib/widgets/response_widgets.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/widgets/response_widgets.dart b/lib/widgets/response_widgets.dart index 54a93db9..ce07c100 100644 --- a/lib/widgets/response_widgets.dart +++ b/lib/widgets/response_widgets.dart @@ -425,13 +425,8 @@ class _BodySuccessState extends State { (widget.options == kRawBodyViewOptions) ? const SizedBox() : SegmentedButton( - showSelectedIcon: showLabel, - style: const ButtonStyle( - padding: WidgetStatePropertyAll( - EdgeInsets.symmetric( - horizontal: 8, - ), - ), + style: SegmentedButton.styleFrom( + padding: const EdgeInsets.symmetric(horizontal: 8), ), selectedIcon: Icon(currentSeg.icon), segments: widget.options @@ -439,7 +434,10 @@ class _BodySuccessState extends State { (e) => ButtonSegment( value: e, label: Text(e.label), - icon: showLabel ? Icon(e.icon) : null, + icon: constraints.maxWidth > + kMinWindowSize.width + ? Icon(e.icon) + : null, ), ) .toList(),