fixed text style

This commit is contained in:
hannathkadher
2025-01-28 13:27:05 +04:00
parent 4b7f4d4279
commit 9091af2661
4 changed files with 30 additions and 16 deletions

View File

@ -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),
);
}