updated text theme

This commit is contained in:
hannathkadher
2024-11-26 13:58:50 +04:00
parent 5091aa1e49
commit 6fca5afd6b
2 changed files with 9 additions and 47 deletions

View File

@ -45,8 +45,8 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
products: previousState.products, products: previousState.products,
selectedCommunity: previousState.selectedCommunity, selectedCommunity: previousState.selectedCommunity,
)); ));
} }
add(LoadCommunityAndSpacesEvent());
} else { } else {
emit(const SpaceManagementError('Failed to update the community.')); emit(const SpaceManagementError('Failed to update the community.'));
} }

View File

@ -75,7 +75,7 @@ class CommunityStructureHeader extends StatelessWidget {
Flexible( Flexible(
child: Text( child: Text(
communityName!, communityName!,
style: const TextStyle(fontSize: 16, color: ColorsManager.blackColor), style: theme.textTheme.bodyLarge?.copyWith(color: ColorsManager.blackColor),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
), ),
@ -89,7 +89,7 @@ class CommunityStructureHeader extends StatelessWidget {
border: InputBorder.none, border: InputBorder.none,
isDense: true, isDense: true,
), ),
style: const TextStyle(fontSize: 16, color: ColorsManager.blackColor), style: theme.textTheme.bodyLarge?.copyWith(color: ColorsManager.blackColor),
onSubmitted: onNameSubmitted, onSubmitted: onNameSubmitted,
), ),
), ),
@ -103,52 +103,14 @@ class CommunityStructureHeader extends StatelessWidget {
), ),
), ),
const Spacer(flex: 3), // Pushes the Save button to the right const Spacer(flex: 3), // Pushes the Save button to the right
if (isSave) _buildActionButtons(), if (isSave) _buildActionButtons(theme),
], ],
), ),
], ],
); );
} }
Widget _buildCommunityName(double screenWidth) { Widget _buildActionButtons(ThemeData theme) {
return Row(
children: [
if (!isEditingName)
Flexible(
child: Text(
communityName!,
style: const TextStyle(fontSize: 16, color: ColorsManager.blackColor),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
if (isEditingName)
SizedBox(
width: screenWidth * 0.3,
child: TextField(
controller: nameController,
decoration: const InputDecoration(
border: InputBorder.none,
isDense: true,
),
style: const TextStyle(fontSize: 16, color: ColorsManager.blackColor),
onSubmitted: onNameSubmitted,
),
),
const SizedBox(width: 8),
GestureDetector(
onTap: onEditName,
child: SvgPicture.asset(
Assets.iconEdit,
width: 16,
height: 16,
),
),
],
);
}
Widget _buildActionButtons() {
return Wrap( return Wrap(
alignment: WrapAlignment.end, alignment: WrapAlignment.end,
spacing: 10, spacing: 10,
@ -157,6 +119,7 @@ class CommunityStructureHeader extends StatelessWidget {
label: "Save", label: "Save",
icon: const Icon(Icons.save, size: 18, color: ColorsManager.spaceColor), icon: const Icon(Icons.save, size: 18, color: ColorsManager.spaceColor),
onPressed: onSave, onPressed: onSave,
theme: theme
), ),
], ],
); );
@ -166,8 +129,9 @@ class CommunityStructureHeader extends StatelessWidget {
required String label, required String label,
required Widget icon, required Widget icon,
required VoidCallback onPressed, required VoidCallback onPressed,
required ThemeData theme
}) { }) {
final double buttonHeight = 30; const double buttonHeight = 30;
return ConstrainedBox( return ConstrainedBox(
constraints: BoxConstraints(maxWidth: 80, minHeight: buttonHeight), constraints: BoxConstraints(maxWidth: 80, minHeight: buttonHeight),
child: DefaultButton( child: DefaultButton(
@ -187,7 +151,7 @@ class CommunityStructureHeader extends StatelessWidget {
Flexible( Flexible(
child: Text( child: Text(
label, label,
style: const TextStyle(fontSize: 13), style: theme.textTheme.bodySmall?.copyWith(color: ColorsManager.blackColor),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,
), ),
@ -197,6 +161,4 @@ class CommunityStructureHeader extends StatelessWidget {
), ),
); );
} }
} }