updated theme

This commit is contained in:
hannathkadher
2024-11-23 20:53:40 +04:00
parent fb6a49354e
commit ca58d44c02

View File

@ -8,6 +8,7 @@ import 'package:syncrow_web/pages/spaces_management/widgets/add_device_type_widg
import 'package:syncrow_web/pages/spaces_management/widgets/hoverable_button.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/constants/space_icon_const.dart';
class CreateSpaceDialog extends StatefulWidget {
final Function(String, String, List<SelectedProduct> selectedProducts) onCreateSpace;
@ -155,11 +156,10 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
),
),
const SizedBox(height: 16),
// Add Devices or Space Model Button
if (selectedProducts.isNotEmpty)
_buildSelectedProductsButtons(widget.products ?? [])
else
ElevatedButton(
DefaultButton(
onPressed: () {
showDialog(
context: context,
@ -173,18 +173,11 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
),
);
},
style: ElevatedButton.styleFrom(
backgroundColor: ColorsManager.textFieldGreyColor,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
shape: RoundedRectangleBorder(
side: const BorderSide(
// Add border side here
color:
ColorsManager.neutralGray, // Define your desired border color
width: 2.0, // Define border width
),
borderRadius: BorderRadius.circular(20)),
),
backgroundColor: ColorsManager.textFieldGreyColor,
foregroundColor: Colors.black, // Set the desired text/icon color
borderColor: ColorsManager.neutralGray, // Define border color
borderRadius: 20.0,
padding: 20.0, // Add padding
child: Row(
mainAxisSize:
MainAxisSize.min, // Adjust the button size to fit the content
@ -208,7 +201,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
const SizedBox(width: 8),
],
),
),
)
],
),
),
@ -270,17 +263,17 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
crossAxisSpacing: 10,
mainAxisSpacing: 22,
),
itemCount: _iconList.length,
itemCount: spaceIconList.length,
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
onTap: () {
setState(() {
selectedIcon = _iconList[index];
selectedIcon = spaceIconList[index];
});
Navigator.of(context).pop();
},
child: SvgPicture.asset(
_iconList[index],
spaceIconList[index],
width: 50,
height: 50,
),
@ -306,10 +299,9 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
),
),
child: Wrap(
spacing: 8, // Horizontal spacing between buttons
runSpacing: 8, // Vertical spacing between rows
spacing: 8,
runSpacing: 8,
children: [
// Dynamically create a button for each selected product
for (var product in selectedProducts)
HoverableButton(
iconPath: _mapIconToProduct(product.productId, products),
@ -369,24 +361,6 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
),
);
return product.icon ?? Assets.presenceSensor;
}
final List<String> _iconList = [
Assets.location,
Assets.villa,
Assets.gym,
Assets.sauna,
Assets.bbq,
Assets.building,
Assets.desk,
Assets.door,
Assets.parking,
Assets.pool,
Assets.stair,
Assets.steamRoom,
Assets.street,
Assets.unit,
];
}