diff --git a/lib/common/edit_chip.dart b/lib/common/edit_chip.dart index 7607834d..1643b414 100644 --- a/lib/common/edit_chip.dart +++ b/lib/common/edit_chip.dart @@ -26,7 +26,7 @@ class EditChip extends StatelessWidget { child: Chip( label: Text( label, - style: TextStyle(color: labelColor), + style: Theme.of(context).textTheme.bodySmall!.copyWith(color: labelColor) ), backgroundColor: backgroundColor, shape: RoundedRectangleBorder( diff --git a/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart b/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart index e172231e..2fb2a5b0 100644 --- a/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart +++ b/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart @@ -102,14 +102,19 @@ class CreateSpaceModelDialog extends StatelessWidget { name: value, allModels: otherSpaceModels ?? [])); }, - style: const TextStyle(color: ColorsManager.blackColor), + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith(color: ColorsManager.blackColor), decoration: InputDecoration( filled: true, fillColor: ColorsManager.textFieldGreyColor, hintText: 'Please enter the name', errorText: state.errorMessage, - hintStyle: const TextStyle( - color: ColorsManager.lightGrayColor), + hintStyle: Theme.of(context) + .textTheme + .bodySmall! + .copyWith(color: ColorsManager.lightGrayColor), border: OutlineInputBorder( borderRadius: BorderRadius.circular(10), borderSide: BorderSide.none, @@ -159,7 +164,9 @@ class CreateSpaceModelDialog extends StatelessWidget { const SizedBox(width: 10), Expanded( child: DefaultButton( - onPressed: (state.errorMessage == null) + onPressed: ((state.errorMessage != null && + state.errorMessage != '') || + !isNameValid) ? () { final updatedSpaceTemplate = updatedSpaceModel.copyWith( @@ -237,8 +244,9 @@ class CreateSpaceModelDialog extends StatelessWidget { : null, backgroundColor: ColorsManager.secondaryColor, borderRadius: 10, - foregroundColor: (state.errorMessage != null && - state.errorMessage != '') + foregroundColor: ((state.errorMessage != null && + state.errorMessage != '') || + !isNameValid) ? ColorsManager.whiteColorsWithOpacity : ColorsManager.whiteColors, child: const Text('OK'), @@ -252,7 +260,10 @@ class CreateSpaceModelDialog extends StatelessWidget { } else if (state is CreateSpaceModelError) { return Text( 'Error: ${state.message}', - style: const TextStyle(color: ColorsManager.warningRed), + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith(color: ColorsManager.warningRed), ); } diff --git a/lib/pages/spaces_management/space_model/widgets/subspace_name_label_widget.dart b/lib/pages/spaces_management/space_model/widgets/subspace_name_label_widget.dart index 2ecbf0b1..63edcf8f 100644 --- a/lib/pages/spaces_management/space_model/widgets/subspace_name_label_widget.dart +++ b/lib/pages/spaces_management/space_model/widgets/subspace_name_label_widget.dart @@ -118,10 +118,10 @@ class _SubspaceNameDisplayWidgetState extends State { padding: const EdgeInsets.only(top: 4.0), child: Text( errorText!, - style: const TextStyle( - color: ColorsManager.warningRed, - fontSize: 12, - ), + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith(color: ColorsManager.warningRed), ), ), ], diff --git a/lib/pages/spaces_management/space_model/widgets/tag_chips_display_widget.dart b/lib/pages/spaces_management/space_model/widgets/tag_chips_display_widget.dart index 11c7ca5b..a07f9b29 100644 --- a/lib/pages/spaces_management/space_model/widgets/tag_chips_display_widget.dart +++ b/lib/pages/spaces_management/space_model/widgets/tag_chips_display_widget.dart @@ -73,9 +73,12 @@ class TagChipDisplay extends StatelessWidget { ), label: Text( 'x${entry.value}', // Show count - style: const TextStyle( - color: ColorsManager.spaceColor, - ), + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + color: + ColorsManager.spaceColor), ), backgroundColor: ColorsManager.whiteColors, shape: RoundedRectangleBorder( @@ -89,7 +92,7 @@ class TagChipDisplay extends StatelessWidget { EditChip(onTap: () async { // Use the Navigator's context for showDialog Navigator.of(context).pop(); - + await showDialog( barrierDismissible: false, context: context,