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

@ -26,7 +26,7 @@ class EditChip extends StatelessWidget {
child: Chip( child: Chip(
label: Text( label: Text(
label, label,
style: TextStyle(color: labelColor), style: Theme.of(context).textTheme.bodySmall!.copyWith(color: labelColor)
), ),
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(

View File

@ -102,14 +102,19 @@ class CreateSpaceModelDialog extends StatelessWidget {
name: value, name: value,
allModels: otherSpaceModels ?? [])); allModels: otherSpaceModels ?? []));
}, },
style: const TextStyle(color: ColorsManager.blackColor), style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: ColorsManager.blackColor),
decoration: InputDecoration( decoration: InputDecoration(
filled: true, filled: true,
fillColor: ColorsManager.textFieldGreyColor, fillColor: ColorsManager.textFieldGreyColor,
hintText: 'Please enter the name', hintText: 'Please enter the name',
errorText: state.errorMessage, errorText: state.errorMessage,
hintStyle: const TextStyle( hintStyle: Theme.of(context)
color: ColorsManager.lightGrayColor), .textTheme
.bodySmall!
.copyWith(color: ColorsManager.lightGrayColor),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
borderSide: BorderSide.none, borderSide: BorderSide.none,
@ -159,7 +164,9 @@ class CreateSpaceModelDialog extends StatelessWidget {
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
onPressed: (state.errorMessage == null) onPressed: ((state.errorMessage != null &&
state.errorMessage != '') ||
!isNameValid)
? () { ? () {
final updatedSpaceTemplate = final updatedSpaceTemplate =
updatedSpaceModel.copyWith( updatedSpaceModel.copyWith(
@ -237,8 +244,9 @@ class CreateSpaceModelDialog extends StatelessWidget {
: null, : null,
backgroundColor: ColorsManager.secondaryColor, backgroundColor: ColorsManager.secondaryColor,
borderRadius: 10, borderRadius: 10,
foregroundColor: (state.errorMessage != null && foregroundColor: ((state.errorMessage != null &&
state.errorMessage != '') state.errorMessage != '') ||
!isNameValid)
? ColorsManager.whiteColorsWithOpacity ? ColorsManager.whiteColorsWithOpacity
: ColorsManager.whiteColors, : ColorsManager.whiteColors,
child: const Text('OK'), child: const Text('OK'),
@ -252,7 +260,10 @@ 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: ColorsManager.warningRed), style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(color: ColorsManager.warningRed),
); );
} }

View File

@ -118,10 +118,10 @@ class _SubspaceNameDisplayWidgetState extends State<SubspaceNameDisplayWidget> {
padding: const EdgeInsets.only(top: 4.0), padding: const EdgeInsets.only(top: 4.0),
child: Text( child: Text(
errorText!, errorText!,
style: const TextStyle( style: Theme.of(context)
color: ColorsManager.warningRed, .textTheme
fontSize: 12, .bodyMedium!
), .copyWith(color: ColorsManager.warningRed),
), ),
), ),
], ],

View File

@ -73,9 +73,12 @@ class TagChipDisplay extends StatelessWidget {
), ),
label: Text( label: Text(
'x${entry.value}', // Show count 'x${entry.value}', // Show count
style: const TextStyle( style: Theme.of(context)
color: ColorsManager.spaceColor, .textTheme
), .bodySmall!
.copyWith(
color:
ColorsManager.spaceColor),
), ),
backgroundColor: ColorsManager.whiteColors, backgroundColor: ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -89,7 +92,7 @@ class TagChipDisplay extends StatelessWidget {
EditChip(onTap: () async { EditChip(onTap: () async {
// Use the Navigator's context for showDialog // Use the Navigator's context for showDialog
Navigator.of(context).pop(); Navigator.of(context).pop();
await showDialog<bool>( await showDialog<bool>(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,