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