mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-24 23:42:28 +00:00
Enhance ButtonContentWidget to support customizable icon dimensions.
This commit is contained in:
@ -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),
|
||||||
|
@ -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,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -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,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user