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

View File

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

View File

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