color manager

This commit is contained in:
hannathkadher
2025-01-09 13:32:09 +04:00
parent 390f7288bd
commit 097e70b906
17 changed files with 88 additions and 79 deletions

View File

@ -99,7 +99,7 @@ class _AddDeviceWidgetState extends State<AddDeviceWidget> {
_buildActionButton('Cancel', ColorsManager.boxColor, ColorsManager.blackColor, () { _buildActionButton('Cancel', ColorsManager.boxColor, ColorsManager.blackColor, () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}), }),
_buildActionButton('Continue', ColorsManager.secondaryColor, Colors.white, () { _buildActionButton('Continue', ColorsManager.secondaryColor, ColorsManager.whiteColors, () {
Navigator.of(context).pop(); Navigator.of(context).pop();
if (widget.onProductsSelected != null) { if (widget.onProductsSelected != null) {
widget.onProductsSelected!(productCounts); widget.onProductsSelected!(productCounts);

View File

@ -178,7 +178,7 @@ class _CommunityStructureHeaderState extends State<CommunityStructureHeader> {
padding: 2.0, padding: 2.0,
height: buttonHeight, height: buttonHeight,
elevation: 0, elevation: 0,
borderColor: Colors.grey.shade300, borderColor: ColorsManager.lightGrayColor,
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [

View File

@ -104,7 +104,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
width: screenWidth * 0.020, width: screenWidth * 0.020,
height: screenWidth * 0.020, height: screenWidth * 0.020,
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Colors.white, color: ColorsManager.whiteColors,
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: SvgPicture.asset( child: SvgPicture.asset(
@ -143,7 +143,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
} }
}); });
}, },
style: const TextStyle(color: Colors.black), style: const TextStyle(color: ColorsManager.blackColor),
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Please enter the name', hintText: 'Please enter the name',
hintStyle: const TextStyle( hintStyle: const TextStyle(
@ -212,7 +212,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
); );
}, },
backgroundColor: ColorsManager.textFieldGreyColor, backgroundColor: ColorsManager.textFieldGreyColor,
foregroundColor: Colors.black, foregroundColor: ColorsManager.blackColor,
borderColor: ColorsManager.neutralGray, borderColor: ColorsManager.neutralGray,
borderRadius: 16.0, borderRadius: 16.0,
padding: 10.0, // Reduced padding for smaller size padding: 10.0, // Reduced padding for smaller size

View File

@ -40,8 +40,8 @@ void showDeleteConfirmationDialog(BuildContext context, VoidCallback onConfirm,
Navigator.of(context).pop(); // Close the first dialog Navigator.of(context).pop(); // Close the first dialog
showProcessingPopup(context, isSpace, onConfirm); showProcessingPopup(context, isSpace, onConfirm);
}, },
style: _dialogButtonStyle(Colors.blue), style: _dialogButtonStyle(ColorsManager.spaceColor),
child: const Text('Continue', style: TextStyle(color: Colors.white)), child: const Text('Continue', style: TextStyle(color: ColorsManager.whiteColors)),
), ),
], ],
), ),
@ -83,7 +83,7 @@ void showProcessingPopup(BuildContext context, bool isSpace, VoidCallback onDele
ElevatedButton( ElevatedButton(
onPressed: onDelete, onPressed: onDelete,
style: _dialogButtonStyle(ColorsManager.warningRed), style: _dialogButtonStyle(ColorsManager.warningRed),
child: const Text('Delete', style: TextStyle(color: Colors.white)), child: const Text('Delete', style: TextStyle(color: ColorsManager.whiteColors)),
), ),
CancelButton( CancelButton(
label: 'Cancel', label: 'Cancel',
@ -108,7 +108,7 @@ Widget _buildWarningIcon() {
color: ColorsManager.warningRed, color: ColorsManager.warningRed,
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: const Icon(Icons.close, color: Colors.white, size: 40), child: const Icon(Icons.close, color: ColorsManager.whiteColors, size: 40),
); );
} }

View File

@ -28,7 +28,7 @@ class IconSelectionDialog extends StatelessWidget {
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.2), // Shadow color color: ColorsManager.blackColor.withOpacity(0.2), // Shadow color
blurRadius: 20, // Spread of the blur blurRadius: 20, // Spread of the blur
offset: const Offset(0, 8), // Offset of the shadow offset: const Offset(0, 8), // Offset of the shadow
), ),

View File

@ -45,7 +45,7 @@ class PlusButtonWidget extends StatelessWidget {
color: ColorsManager.spaceColor, color: ColorsManager.spaceColor,
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: const Icon(Icons.add, color: Colors.white, size: 20), child: const Icon(Icons.add, color: ColorsManager.whiteColors, size: 20),
), ),
), ),
); );

View File

@ -120,7 +120,7 @@ class _SidebarWidgetState extends State<SidebarWidget> {
children: [ children: [
Text('Communities', Text('Communities',
style: Theme.of(context).textTheme.titleMedium?.copyWith( style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Colors.black, color: ColorsManager.blackColor,
)), )),
GestureDetector( GestureDetector(
onTap: () => _navigateToBlank(context), onTap: () => _navigateToBlank(context),

View File

@ -78,7 +78,7 @@ class SpaceContainerWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: ColorsManager.lightGrayColor.withOpacity(0.5),
spreadRadius: 2, spreadRadius: 2,
blurRadius: 5, blurRadius: 5,
offset: const Offset(0, 3), // Shadow position offset: const Offset(0, 3), // Shadow position

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class SpaceWidget extends StatelessWidget { class SpaceWidget extends StatelessWidget {
final String name; final String name;
@ -23,11 +24,11 @@ class SpaceWidget extends StatelessWidget {
Container( Container(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: ColorsManager.lightGrayColor.withOpacity(0.5),
spreadRadius: 5, spreadRadius: 5,
blurRadius: 7, blurRadius: 7,
offset: const Offset(0, 3), offset: const Offset(0, 3),
@ -36,7 +37,7 @@ class SpaceWidget extends StatelessWidget {
), ),
child: Row( child: Row(
children: [ children: [
const Icon(Icons.location_on, color: Colors.blue), const Icon(Icons.location_on, color: ColorsManager.spaceColor),
const SizedBox(width: 8), const SizedBox(width: 8),
Text(name, style: const TextStyle(fontSize: 16)), Text(name, style: const TextStyle(fontSize: 16)),
], ],

View File

@ -96,7 +96,7 @@ class AssignTagModelsDialog extends StatelessWidget {
'No Data Available', 'No Data Available',
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Colors.grey, color: ColorsManager.lightGrayColor,
), ),
), ),
), ),
@ -159,7 +159,7 @@ class AssignTagModelsDialog extends StatelessWidget {
), ),
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
color: Colors.black, color: ColorsManager.blackColor,
), ),
), ),
), ),
@ -172,7 +172,7 @@ class AssignTagModelsDialog extends StatelessWidget {
color: ColorsManager.whiteColors, color: ColorsManager.whiteColors,
icon: const Icon( icon: const Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
color: Colors.black), color: ColorsManager.blackColor),
onSelected: (value) { onSelected: (value) {
controller.text = value; controller.text = value;
context context
@ -273,7 +273,7 @@ class AssignTagModelsDialog extends StatelessWidget {
if (state.errorMessage != null) if (state.errorMessage != null)
Text( Text(
state.errorMessage!, state.errorMessage!,
style: const TextStyle(color: Colors.red), style: const TextStyle(color: ColorsManager.warningRed),
), ),
], ],
), ),

View File

@ -5,6 +5,7 @@ import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model
import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_event.dart'; import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_event.dart';
import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_state.dart'; import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_state.dart';
import 'package:syncrow_web/pages/spaces_management/space_model/models/space_template_model.dart'; import 'package:syncrow_web/pages/spaces_management/space_model/models/space_template_model.dart';
import 'package:syncrow_web/pages/spaces_management/space_model/widgets/add_space_model_widget.dart';
import 'package:syncrow_web/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart'; import 'package:syncrow_web/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart';
import 'package:syncrow_web/pages/spaces_management/space_model/widgets/space_model_card_widget.dart'; import 'package:syncrow_web/pages/spaces_management/space_model/widgets/space_model_card_widget.dart';
import 'package:syncrow_web/utils/color_manager.dart'; import 'package:syncrow_web/utils/color_manager.dart';
@ -61,7 +62,7 @@ class SpaceModelPage extends StatelessWidget {
}, },
); );
}, },
child: _buildAddContainer(), child: const AddSpaceModelWidget(),
); );
} }
// Render existing space model // Render existing space model
@ -81,7 +82,7 @@ class SpaceModelPage extends StatelessWidget {
return Center( return Center(
child: Text( child: Text(
'Error: ${state.message}', 'Error: ${state.message}',
style: const TextStyle(color: Colors.red), style: const TextStyle(color: ColorsManager.warningRed),
), ),
); );
} }
@ -90,49 +91,6 @@ class SpaceModelPage extends StatelessWidget {
); );
} }
Widget _buildAddContainer() {
return Container(
margin: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(20),
boxShadow: const [
BoxShadow(
color: ColorsManager.semiTransparentBlackColor,
blurRadius: 15,
offset: Offset(0, 4),
spreadRadius: 0,
),
BoxShadow(
color: ColorsManager.semiTransparentBlackColor,
blurRadius: 25,
offset: Offset(0, 15),
spreadRadius: -5,
),
],
),
child: Center(
child: Container(
width: 60,
height: 0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: ColorsManager.neutralGray,
border: Border.all(
color: ColorsManager.textFieldGreyColor,
width: 2.0,
),
),
child: const Icon(
Icons.add,
size: 40,
color: ColorsManager.spaceColor,
),
),
),
);
}
double _calculateChildAspectRatio(BuildContext context) { double _calculateChildAspectRatio(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
if (screenWidth > 1600) { if (screenWidth > 1600) {

View File

@ -0,0 +1,50 @@
import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';
class AddSpaceModelWidget extends StatelessWidget {
const AddSpaceModelWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(20),
boxShadow: const [
BoxShadow(
color: ColorsManager.semiTransparentBlackColor,
blurRadius: 15,
offset: Offset(0, 4),
spreadRadius: 0,
),
BoxShadow(
color: ColorsManager.semiTransparentBlackColor,
blurRadius: 25,
offset: Offset(0, 15),
spreadRadius: -5,
),
],
),
child: Center(
child: Container(
width: 60,
height: 60, // Set a proper height here
decoration: BoxDecoration(
shape: BoxShape.circle,
color: ColorsManager.neutralGray,
border: Border.all(
color: ColorsManager.textFieldGreyColor,
width: 2.0,
),
),
child: const Icon(
Icons.add,
size: 40,
color: ColorsManager.spaceColor,
),
),
),
);
}
}

View File

@ -174,7 +174,7 @@ class CreateSpaceModelDialog extends StatelessWidget {
} else if (state is CreateSpaceModelError) { } else if (state is CreateSpaceModelError) {
return Text( return Text(
'Error: ${state.message}', 'Error: ${state.message}',
style: const TextStyle(color: Colors.red), style: const TextStyle(color: ColorsManager.warningRed),
); );
} }

View File

@ -33,11 +33,11 @@ class SpaceModelCardWidget extends StatelessWidget {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: ColorsManager.whiteColors,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(0.5), color: ColorsManager.lightGrayColor.withOpacity(0.5),
spreadRadius: 2, spreadRadius: 2,
blurRadius: 5, blurRadius: 5,
offset: const Offset(0, 3), offset: const Offset(0, 3),

View File

@ -25,7 +25,7 @@ class SubspaceChipWidget extends StatelessWidget {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
side: const BorderSide( side: const BorderSide(
color: Colors.transparent, color: ColorsManager.transparentColor,
width: 0, width: 0,
), ),
), ),

View File

@ -85,7 +85,7 @@ class SubspaceModelCreate extends StatelessWidget {
style: const TextStyle( style: const TextStyle(
color: ColorsManager.spaceColor), // Text color color: ColorsManager.spaceColor), // Text color
), ),
backgroundColor: Colors.white, // Chip background color backgroundColor: ColorsManager.whiteColors, // Chip background color
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular(16), // Rounded chip BorderRadius.circular(16), // Rounded chip
@ -118,15 +118,15 @@ class SubspaceModelCreate extends StatelessWidget {
label: const Text( label: const Text(
'Edit', 'Edit',
style: TextStyle( style: TextStyle(
color: ColorsManager.spaceColor), // Text color color: ColorsManager.spaceColor),
), ),
backgroundColor: backgroundColor:
Colors.white, // Background color for "Edit" ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.circular(16), // Rounded chip BorderRadius.circular(16),
side: const BorderSide( side: const BorderSide(
color: ColorsManager.spaceColor), // Border color color: ColorsManager.spaceColor),
), ),
), ),
), ),

View File

@ -71,7 +71,7 @@ class TagChipDisplay extends StatelessWidget {
color: ColorsManager.spaceColor, color: ColorsManager.spaceColor,
), ),
), ),
backgroundColor: Colors.white, backgroundColor: ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
side: const BorderSide( side: const BorderSide(
@ -104,14 +104,14 @@ class TagChipDisplay extends StatelessWidget {
label: const Text( label: const Text(
'Edit', 'Edit',
style: TextStyle( style: TextStyle(
color: ColorsManager.spaceColor), // Text color color: ColorsManager.spaceColor),
), ),
backgroundColor: backgroundColor:
Colors.white, // Background color for "Edit" ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), // Rounded chip borderRadius: BorderRadius.circular(16),
side: const BorderSide( side: const BorderSide(
color: ColorsManager.spaceColor), // Border color color: ColorsManager.spaceColor),
), ),
), ),
), ),