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,
selectedCommunity: previousState.selectedCommunity,
));
}
add(LoadCommunityAndSpacesEvent());
} else {
emit(const SpaceManagementError('Failed to update the community.'));
}

View File

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