Refactor constructor formatting and improve readability in CustomExpansionTileSpaceTree.

This commit is contained in:
Faris Armoush
2025-04-16 14:44:31 +03:00
parent f1667d4458
commit f709b92e12

View File

@ -11,16 +11,17 @@ class CustomExpansionTileSpaceTree extends StatelessWidget {
final void Function()? onExpansionChanged; final void Function()? onExpansionChanged;
final void Function()? onItemSelected; final void Function()? onItemSelected;
const CustomExpansionTileSpaceTree( const CustomExpansionTileSpaceTree({
{super.key, required this.isSelected,
this.spaceId, required this.title,
required this.title, this.spaceId,
this.children, this.children,
this.isExpanded = false, this.onExpansionChanged,
this.onExpansionChanged, this.onItemSelected,
this.onItemSelected, this.isExpanded = false,
required this.isSelected, this.isSoldCheck = false,
this.isSoldCheck = false}); super.key,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -56,7 +57,9 @@ class CustomExpansionTileSpaceTree extends StatelessWidget {
} }
}, },
child: Icon( child: Icon(
isExpanded ? Icons.keyboard_arrow_down : Icons.keyboard_arrow_right, isExpanded
? Icons.keyboard_arrow_down
: Icons.keyboard_arrow_right,
color: ColorsManager.lightGrayColor, color: ColorsManager.lightGrayColor,
size: 16.0, size: 16.0,
), ),
@ -72,7 +75,8 @@ class CustomExpansionTileSpaceTree extends StatelessWidget {
_capitalizeFirstLetter(title), _capitalizeFirstLetter(title),
style: Theme.of(context).textTheme.bodySmall!.copyWith( style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: isSelected color: isSelected
? ColorsManager.blackColor // Change color to black when selected ? ColorsManager
.blackColor // Change color to black when selected
: ColorsManager.lightGrayColor, // Gray when not selected : ColorsManager.lightGrayColor, // Gray when not selected
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),