Enhance ButtonContentWidget to support customizable icon dimensions.

This commit is contained in:
Faris Armoush
2025-07-24 11:59:21 +03:00
parent 99924c1e62
commit c4ed30f539
3 changed files with 10 additions and 2 deletions

View File

@ -6,11 +6,15 @@ class ButtonContentWidget extends StatelessWidget {
final String label;
final String? svgAssets;
final bool disabled;
final double? iconWidth;
final double? iconHeight;
const ButtonContentWidget({
required this.label,
this.svgAssets,
this.disabled = false,
this.iconWidth,
this.iconHeight,
super.key,
});
@ -38,8 +42,8 @@ class ButtonContentWidget extends StatelessWidget {
padding: const EdgeInsets.only(left: 6.0),
child: SvgPicture.asset(
svgAssets!,
width: screenWidth * 0.015,
height: screenWidth * 0.015,
width: iconWidth ?? screenWidth * 0.015,
height: iconHeight ?? screenWidth * 0.015,
),
),
const SizedBox(width: 10),

View File

@ -90,6 +90,8 @@ class SpaceDetailsDevicesBox extends StatelessWidget {
child: ButtonContentWidget(
svgAssets: Assets.addIcon,
label: 'Add Devices',
iconWidth: 12,
iconHeight: 12,
),
),
);

View File

@ -28,6 +28,8 @@ class SpaceSubSpacesBox extends StatelessWidget {
child: ButtonContentWidget(
svgAssets: Assets.addIcon,
label: 'Create Sub Spaces',
iconWidth: 12,
iconHeight: 12,
),
),
);