From 986fdc1d5f1f8af392736a0e2f5b0c8f4515728e Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:09:54 -0500 Subject: [PATCH] fix: add padding inside morph choices scroll view (#1444) --- .../morphs/morphological_center_widget.dart | 96 ++++++++++--------- 1 file changed, 50 insertions(+), 46 deletions(-) diff --git a/lib/pangea/toolbar/widgets/word_zoom/morphs/morphological_center_widget.dart b/lib/pangea/toolbar/widgets/word_zoom/morphs/morphological_center_widget.dart index 894ac4918..f71cbd703 100644 --- a/lib/pangea/toolbar/widgets/word_zoom/morphs/morphological_center_widget.dart +++ b/lib/pangea/toolbar/widgets/word_zoom/morphs/morphological_center_widget.dart @@ -197,56 +197,60 @@ class MorphologicalCenterWidgetState extends State { child: SingleChildScrollView( controller: _scrollController, scrollDirection: Axis.vertical, - child: Wrap( - alignment: WrapAlignment.center, - children: allMorphTagsForEdit.map((tag) { - return Container( - margin: const EdgeInsets.all(2), - padding: EdgeInsets.zero, - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(10)), - border: Border.all( - color: selectedMorphTag == tag - ? Theme.of(context).colorScheme.primary - : Colors.transparent, - style: BorderStyle.solid, - width: 2.0, - ), - ), - child: TextButton( - style: ButtonStyle( - padding: WidgetStateProperty.all( - const EdgeInsets.symmetric(horizontal: 7), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Wrap( + alignment: WrapAlignment.center, + children: allMorphTagsForEdit.map((tag) { + return Container( + margin: const EdgeInsets.all(2), + padding: EdgeInsets.zero, + decoration: BoxDecoration( + borderRadius: + const BorderRadius.all(Radius.circular(10)), + border: Border.all( + color: selectedMorphTag == tag + ? Theme.of(context).colorScheme.primary + : Colors.transparent, + style: BorderStyle.solid, + width: 2.0, ), - backgroundColor: selectedMorphTag == tag - ? WidgetStateProperty.all( - Theme.of(context) - .colorScheme - .primary - .withAlpha(50), - ) - : null, - shape: WidgetStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), + ), + child: TextButton( + style: ButtonStyle( + padding: WidgetStateProperty.all( + const EdgeInsets.symmetric(horizontal: 7), + ), + backgroundColor: selectedMorphTag == tag + ? WidgetStateProperty.all( + Theme.of(context) + .colorScheme + .primary + .withAlpha(50), + ) + : null, + shape: WidgetStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), ), ), + onPressed: () { + setState(() => selectedMorphTag = tag); + }, + child: Text( + getGrammarCopy( + category: widget.morphFeature, + lemma: tag, + context: context, + ) ?? + tag, + textAlign: TextAlign.center, + ), ), - onPressed: () { - setState(() => selectedMorphTag = tag); - }, - child: Text( - getGrammarCopy( - category: widget.morphFeature, - lemma: tag, - context: context, - ) ?? - tag, - textAlign: TextAlign.center, - ), - ), - ); - }).toList(), + ); + }).toList(), + ), ), ), ),