Update SpaceDetailsDialog to utilize SelectableText for error messages and ensure proper Bloc context usage. This enhances user experience by allowing text selection for easier copying of error information.

This commit is contained in:
Faris Armoush
2025-07-03 13:19:42 +03:00
parent fc797c2646
commit 9451ec0cc4

View File

@ -58,6 +58,7 @@ class _SpaceDetailsDialogState extends State<SpaceDetailsDialog> {
} }
return BlocBuilder<SpaceDetailsBloc, SpaceDetailsState>( return BlocBuilder<SpaceDetailsBloc, SpaceDetailsState>(
bloc: widget.context.read<SpaceDetailsBloc>(),
builder: (context, state) => switch (state) { builder: (context, state) => switch (state) {
SpaceDetailsInitial() => _buildLoadingDialog(), SpaceDetailsInitial() => _buildLoadingDialog(),
SpaceDetailsLoading() => _buildLoadingDialog(), SpaceDetailsLoading() => _buildLoadingDialog(),
@ -86,7 +87,7 @@ class _SpaceDetailsDialogState extends State<SpaceDetailsDialog> {
title: widget.title, title: widget.title,
backgroundColor: ColorsManager.whiteColors, backgroundColor: ColorsManager.whiteColors,
content: Center( content: Center(
child: Text( child: SelectableText(
errorMessage, errorMessage,
style: context.textTheme.bodyLarge?.copyWith( style: context.textTheme.bodyLarge?.copyWith(
color: ColorsManager.red, color: ColorsManager.red,