diff --git a/lib/pages/space_tree/view/custom_expansion.dart b/lib/pages/space_tree/view/custom_expansion.dart index c9755180..2d969489 100644 --- a/lib/pages/space_tree/view/custom_expansion.dart +++ b/lib/pages/space_tree/view/custom_expansion.dart @@ -49,21 +49,7 @@ class CustomExpansionTileSpaceTree extends StatelessWidget { }), checkColor: ColorsManager.whiteColors, ), - if (children != null && children!.isNotEmpty) - InkWell( - onTap: () { - if (onExpansionChanged != null) { - onExpansionChanged!(); - } - }, - child: Icon( - isExpanded - ? Icons.keyboard_arrow_down - : Icons.keyboard_arrow_right, - color: ColorsManager.lightGrayColor, - size: 16.0, - ), - ), + _buildExpansionIcon(), Expanded( child: GestureDetector( onTap: () { @@ -96,6 +82,20 @@ class CustomExpansionTileSpaceTree extends StatelessWidget { ); } + Widget _buildExpansionIcon() { + return Visibility( + visible: children != null && children!.isNotEmpty, + child: InkWell( + onTap: onExpansionChanged, + child: Icon( + isExpanded ? Icons.keyboard_arrow_down : Icons.keyboard_arrow_right, + color: ColorsManager.lightGrayColor, + size: 16.0, + ), + ), + ); + } + String _capitalizeFirstLetter(String text) { if (text.isEmpty) return text; return text[0].toUpperCase() + text.substring(1);