updated text theme

This commit is contained in:
hannathkadher
2025-01-29 10:21:06 +04:00
parent 8870467fe4
commit 073916d4ac
9 changed files with 145 additions and 130 deletions

View File

@ -173,14 +173,13 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
} }
}); });
}, },
style: const TextStyle(color: Colors.black), style: Theme.of(context).textTheme.bodyMedium,
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Please enter the name', hintText: 'Please enter the name',
hintStyle: const TextStyle( hintStyle: Theme.of(context)
fontSize: 14, .textTheme
color: ColorsManager.lightGrayColor, .bodyMedium!
fontWeight: FontWeight.w400, .copyWith(color: ColorsManager.lightGrayColor),
),
filled: true, filled: true,
fillColor: ColorsManager.boxColor, fillColor: ColorsManager.boxColor,
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
@ -253,8 +252,11 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
Chip( Chip(
label: Text( label: Text(
selectedSpaceModel?.modelName ?? '', selectedSpaceModel?.modelName ?? '',
style: const TextStyle( style: Theme.of(context)
color: ColorsManager.spaceColor), .textTheme
.bodyMedium!
.copyWith(
color: ColorsManager.spaceColor),
), ),
backgroundColor: ColorsManager.whiteColors, backgroundColor: ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -287,25 +289,25 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
), ),
), ),
const SizedBox(height: 25), const SizedBox(height: 25),
const Row( Row(
children: [ children: [
Expanded( const Expanded(
child: Divider( child: Divider(
color: ColorsManager.neutralGray, color: ColorsManager.neutralGray,
thickness: 1.0, thickness: 1.0,
), ),
), ),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 6.0), padding: const EdgeInsets.symmetric(horizontal: 6.0),
child: Text( child: Text(
'OR', 'OR',
style: TextStyle( style: Theme.of(context)
color: Colors.black, .textTheme
fontWeight: FontWeight.bold, .bodyMedium
), ?.copyWith(fontWeight: FontWeight.bold),
), ),
), ),
Expanded( const Expanded(
child: Divider( child: Divider(
color: ColorsManager.neutralGray, color: ColorsManager.neutralGray,
thickness: 1.0, thickness: 1.0,
@ -418,9 +420,12 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
), ),
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: backgroundColor:
ColorsManager.whiteColors, ColorsManager.whiteColors,

View File

@ -20,8 +20,7 @@ class SpaceWidget extends StatelessWidget {
top: position.dy, top: position.dy,
child: GestureDetector( child: GestureDetector(
onTap: onTap, onTap: onTap,
child: child: Container(
Container(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ColorsManager.whiteColors, color: ColorsManager.whiteColors,
@ -39,11 +38,10 @@ class SpaceWidget extends StatelessWidget {
children: [ children: [
const Icon(Icons.location_on, color: ColorsManager.spaceColor), 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: Theme.of(context).textTheme.bodyMedium),
], ],
), ),
), ),
), ),
); );
} }

View File

@ -97,21 +97,22 @@ class AssignTagDialog extends StatelessWidget {
], ],
rows: state.tags.isEmpty rows: state.tags.isEmpty
? [ ? [
const DataRow(cells: [ DataRow(cells: [
DataCell( DataCell(
Center( Center(
child: Text( child: Text('No Data Available',
'No Data Available', style: Theme.of(context)
style: TextStyle( .textTheme
fontSize: 14, .bodyMedium
color: ColorsManager.lightGrayColor, ?.copyWith(
), color: ColorsManager
), .lightGrayColor,
)),
), ),
), ),
DataCell(SizedBox()), const DataCell(SizedBox()),
DataCell(SizedBox()), const DataCell(SizedBox()),
DataCell(SizedBox()), const DataCell(SizedBox()),
]) ])
] ]
: List.generate(state.tags.length, (index) { : List.generate(state.tags.length, (index) {
@ -213,10 +214,11 @@ class AssignTagDialog extends StatelessWidget {
), ),
), ),
if (state.errorMessage != null) if (state.errorMessage != null)
Text( Text(state.errorMessage!,
state.errorMessage!, style: Theme.of(context)
style: const TextStyle(color: ColorsManager.warningRed), .textTheme
), .bodySmall
?.copyWith(color: ColorsManager.warningRed)),
], ],
), ),
), ),
@ -320,7 +322,7 @@ class AssignTagDialog extends StatelessWidget {
); );
} }
} }
for (var tag in modifiedTags.toList()) { for (var tag in modifiedTags.toList()) {
if (modifiedSubspaces.isEmpty) continue; if (modifiedSubspaces.isEmpty) continue;
final prevIndice = checkTagExistInSubspace(tag, modifiedSubspaces); final prevIndice = checkTagExistInSubspace(tag, modifiedSubspaces);

View File

@ -112,22 +112,22 @@ class AssignTagModelsDialog extends StatelessWidget {
], ],
rows: state.tags.isEmpty rows: state.tags.isEmpty
? [ ? [
const DataRow(cells: [ DataRow(cells: [
DataCell( DataCell(
Center( Center(
child: Text( child: Text('No Devices Available',
'No Data Available', style: Theme.of(context)
style: TextStyle( .textTheme
fontSize: 14, .bodyMedium
color: ?.copyWith(
ColorsManager.lightGrayColor, color: ColorsManager
), .lightGrayColor,
), )),
), ),
), ),
DataCell(SizedBox()), const DataCell(SizedBox()),
DataCell(SizedBox()), const DataCell(SizedBox()),
DataCell(SizedBox()), const DataCell(SizedBox()),
]) ])
] ]
: List.generate(state.tags.length, (index) { : List.generate(state.tags.length, (index) {
@ -233,11 +233,11 @@ class AssignTagModelsDialog extends StatelessWidget {
), ),
), ),
if (state.errorMessage != null) if (state.errorMessage != null)
Text( Text(state.errorMessage!,
state.errorMessage!, style: Theme.of(context)
style: const TextStyle( .textTheme
color: ColorsManager.warningRed), .bodySmall
), ?.copyWith(color: ColorsManager.warningRed)),
], ],
), ),
), ),

View File

@ -77,9 +77,7 @@ class CreateCommunityDialog extends StatelessWidget {
.read<CommunityDialogBloc>() .read<CommunityDialogBloc>()
.add(ValidateCommunityNameEvent(value)); .add(ValidateCommunityNameEvent(value));
}, },
style: const TextStyle( style: Theme.of(context).textTheme.bodyMedium,
color: ColorsManager.blackColor,
),
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Please enter the community name', hintText: 'Please enter the community name',
filled: true, filled: true,

View File

@ -102,12 +102,13 @@ class CreateSubSpaceDialog extends StatelessWidget {
duplicateIndices.indexOf(index) != 0; duplicateIndices.indexOf(index) != 0;
return Chip( return Chip(
label: Text( label: Text(subSpace.subspaceName,
subSpace.subspaceName, style: Theme.of(context)
style: const TextStyle( .textTheme
color: ColorsManager.spaceColor, .bodyMedium
), ?.copyWith(
), color:
ColorsManager.spaceColor)),
backgroundColor: ColorsManager.whiteColors, backgroundColor: ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
@ -143,27 +144,29 @@ class CreateSubSpaceDialog extends StatelessWidget {
SizedBox( SizedBox(
width: 200, width: 200,
child: TextField( child: TextField(
controller: textController, controller: textController,
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
hintText: state.subSpaces.isEmpty hintText: state.subSpaces.isEmpty
? 'Please enter the name' ? 'Please enter the name'
: null, : null,
hintStyle: const TextStyle( hintStyle: Theme.of(context)
color: ColorsManager.lightGrayColor), .textTheme
), .bodySmall
onSubmitted: (value) { ?.copyWith(
if (value.trim().isNotEmpty) { color: ColorsManager
context.read<SubSpaceBloc>().add( .lightGrayColor)),
AddSubSpace(SubspaceModel( onSubmitted: (value) {
subspaceName: value.trim(), if (value.trim().isNotEmpty) {
disabled: false))); context.read<SubSpaceBloc>().add(
textController.clear(); AddSubSpace(SubspaceModel(
} subspaceName: value.trim(),
}, disabled: false)));
style: const TextStyle( textController.clear();
color: ColorsManager.blackColor), }
), },
style:
Theme.of(context).textTheme.bodyMedium),
), ),
], ],
), ),
@ -171,13 +174,13 @@ class CreateSubSpaceDialog extends StatelessWidget {
if (state.errorMessage.isNotEmpty) if (state.errorMessage.isNotEmpty)
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(state.errorMessage,
state.errorMessage, style: Theme.of(context)
style: const TextStyle( .textTheme
color: ColorsManager.warningRed, .bodySmall
fontSize: 12, ?.copyWith(
), color: ColorsManager.warningRed,
), )),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Row( Row(

View File

@ -94,12 +94,13 @@ class CreateSubSpaceModelDialog extends StatelessWidget {
duplicateIndices.indexOf(index) != 0; duplicateIndices.indexOf(index) != 0;
return Chip( return Chip(
label: Text( label: Text(subSpace.subspaceName,
subSpace.subspaceName, style: Theme.of(context)
style: const TextStyle( .textTheme
color: ColorsManager.spaceColor, .bodySmall
), ?.copyWith(
), color: ColorsManager.spaceColor,
)),
backgroundColor: ColorsManager.whiteColors, backgroundColor: ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
@ -135,28 +136,33 @@ class CreateSubSpaceModelDialog extends StatelessWidget {
SizedBox( SizedBox(
width: 200, width: 200,
child: TextField( child: TextField(
controller: textController, controller: textController,
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
hintText: state.subSpaces.isEmpty hintText: state.subSpaces.isEmpty
? 'Please enter the name' ? 'Please enter the name'
: null, : null,
hintStyle: const TextStyle( hintStyle: Theme.of(context)
color: ColorsManager.lightGrayColor), .textTheme
), .bodySmall!
onSubmitted: (value) { .copyWith(
if (value.trim().isNotEmpty) { color: ColorsManager
context.read<SubSpaceModelBloc>().add( .lightGrayColor)),
AddSubSpaceModel( onSubmitted: (value) {
SubspaceTemplateModel( if (value.trim().isNotEmpty) {
subspaceName: value.trim(), context.read<SubSpaceModelBloc>().add(
disabled: false))); AddSubSpaceModel(
textController.clear(); SubspaceTemplateModel(
} subspaceName: value.trim(),
}, disabled: false)));
style: const TextStyle( textController.clear();
color: ColorsManager.blackColor), }
), },
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(
color: ColorsManager.blackColor)),
), ),
], ],
), ),
@ -164,13 +170,13 @@ class CreateSubSpaceModelDialog extends StatelessWidget {
if (state.errorMessage.isNotEmpty) if (state.errorMessage.isNotEmpty)
Padding( Padding(
padding: const EdgeInsets.only(bottom: 16.0), padding: const EdgeInsets.only(bottom: 16.0),
child: Text( child: Text(state.errorMessage,
state.errorMessage, style: Theme.of(context)
style: const TextStyle( .textTheme
color: ColorsManager.red, .bodySmall
fontSize: 12, ?.copyWith(
), color: ColorsManager.red,
), )),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Row( Row(

View File

@ -97,7 +97,10 @@ class SpaceModelPage extends StatelessWidget {
return Center( return Center(
child: Text( child: Text(
'Error: ${state.message}', 'Error: ${state.message}',
style: const TextStyle(color: ColorsManager.warningRed), style: Theme.of(context)
.textTheme
.bodySmall
?.copyWith(color: ColorsManager.warningRed),
), ),
); );
} }

View File

@ -29,7 +29,7 @@ class DynamicRoomWidget extends StatelessWidget {
final TextPainter textPainter = TextPainter( final TextPainter textPainter = TextPainter(
text: TextSpan( text: TextSpan(
text: subspace.subspaceName, text: subspace.subspaceName,
style: const TextStyle(fontSize: 16), style: Theme.of(context).textTheme.bodyMedium
), ),
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
)..layout(); )..layout();