Made SpaceSubSpacesDialog scrollable, for a better UX, and to account for a very long list of subspaces.

This commit is contained in:
Faris Armoush
2025-07-27 11:01:22 +03:00
parent cd8ffc99ea
commit 2d69e3c72f

View File

@ -89,28 +89,35 @@ class _SpaceSubSpacesDialogState extends State<SpaceSubSpacesDialog> {
),
child: const SelectableText('Create Sub-Space'),
),
content: Column(
spacing: 12,
mainAxisSize: MainAxisSize.min,
children: [
SubSpacesInput(
subSpaces: _subspaces,
onSubspaceAdded: _handleSubspaceAdded,
onSubspaceDeleted: _handleSubspaceDeleted,
controller: _subspaceNameController,
),
AnimatedSwitcher(
duration: const Duration(milliseconds: 100),
child: Visibility(
key: ValueKey(_hasDuplicateNames),
visible: _hasDuplicateNames,
child: const SelectableText(
'Error: Duplicate subspace names are not allowed.',
style: TextStyle(color: Colors.red),
content: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: context.screenHeight * 0.4,
),
child: SingleChildScrollView(
child: Column(
spacing: 12,
mainAxisSize: MainAxisSize.min,
children: [
SubSpacesInput(
subSpaces: _subspaces,
onSubspaceAdded: _handleSubspaceAdded,
onSubspaceDeleted: _handleSubspaceDeleted,
controller: _subspaceNameController,
),
),
AnimatedSwitcher(
duration: const Duration(milliseconds: 100),
child: Visibility(
key: ValueKey(_hasDuplicateNames),
visible: _hasDuplicateNames,
child: const SelectableText(
'Error: Duplicate subspace names are not allowed.',
style: TextStyle(color: Colors.red),
),
),
),
],
),
],
),
),
actions: [
SpaceDetailsActionButtons(