mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Update SpaceSubSpacesDialog: Replace Text with SelectableText for title and error message, and add spacing in the content column to enhance user experience and maintainability.
This commit is contained in:
@ -16,7 +16,7 @@ abstract final class SpaceDetailsDialogHelper {
|
|||||||
),
|
),
|
||||||
child: SpaceDetailsDialog(
|
child: SpaceDetailsDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: const Text('Create Space'),
|
title: const SelectableText('Create Space'),
|
||||||
spaceModel: SpaceModel.empty(),
|
spaceModel: SpaceModel.empty(),
|
||||||
onSave: print,
|
onSave: print,
|
||||||
),
|
),
|
||||||
@ -36,7 +36,7 @@ abstract final class SpaceDetailsDialogHelper {
|
|||||||
),
|
),
|
||||||
child: SpaceDetailsDialog(
|
child: SpaceDetailsDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: const Text('Edit Space'),
|
title: const SelectableText('Edit Space'),
|
||||||
spaceModel: spaceModel,
|
spaceModel: spaceModel,
|
||||||
onSave: (space) {},
|
onSave: (space) {},
|
||||||
),
|
),
|
||||||
|
@ -28,7 +28,7 @@ class SpaceDetailsForm extends StatelessWidget {
|
|||||||
create: (context) => SpaceDetailsModelBloc(initialState: space),
|
create: (context) => SpaceDetailsModelBloc(initialState: space),
|
||||||
child: BlocBuilder<SpaceDetailsModelBloc, SpaceDetailsModel>(
|
child: BlocBuilder<SpaceDetailsModelBloc, SpaceDetailsModel>(
|
||||||
buildWhen: (previous, current) => previous != current,
|
buildWhen: (previous, current) => previous != current,
|
||||||
builder: (context, state) {
|
builder: (context, space) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: title,
|
title: title,
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.whiteColors,
|
||||||
@ -39,7 +39,7 @@ class SpaceDetailsForm extends StatelessWidget {
|
|||||||
spacing: 20,
|
spacing: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: SpaceIconPicker(iconPath: state.icon)),
|
Expanded(child: SpaceIconPicker(iconPath: space.icon)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -47,17 +47,17 @@ class SpaceDetailsForm extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
SpaceNameTextField(
|
SpaceNameTextField(
|
||||||
initialValue: state.spaceName,
|
initialValue: space.spaceName,
|
||||||
isNameFieldExist: (value) => state.subspaces.any(
|
isNameFieldExist: (value) => space.subspaces.any(
|
||||||
(subspace) => subspace.name == value,
|
(subspace) => subspace.name == value,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
SpaceSubSpacesBox(
|
SpaceSubSpacesBox(
|
||||||
subspaces: state.subspaces,
|
subspaces: space.subspaces,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
SpaceDetailsDevicesBox(space: state),
|
SpaceDetailsDevicesBox(space: space),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -66,7 +66,7 @@ class SpaceDetailsForm extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
SpaceDetailsActionButtons(
|
SpaceDetailsActionButtons(
|
||||||
onSave: () => onSave(state),
|
onSave: () => onSave(space),
|
||||||
onCancel: Navigator.of(context).pop,
|
onCancel: Navigator.of(context).pop,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -56,8 +56,9 @@ class _SpaceSubSpacesDialogState extends State<SpaceSubSpacesDialog> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Create Sub Spaces'),
|
title: const SelectableText('Create Sub Spaces'),
|
||||||
content: Column(
|
content: Column(
|
||||||
|
spacing: 12,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
SubSpacesInput(
|
SubSpacesInput(
|
||||||
@ -70,7 +71,7 @@ class _SpaceSubSpacesDialogState extends State<SpaceSubSpacesDialog> {
|
|||||||
child: Visibility(
|
child: Visibility(
|
||||||
key: ValueKey(_hasDuplicateNames),
|
key: ValueKey(_hasDuplicateNames),
|
||||||
visible: _hasDuplicateNames,
|
visible: _hasDuplicateNames,
|
||||||
child: const Text(
|
child: const SelectableText(
|
||||||
'Error: Duplicate subspace names are not allowed.',
|
'Error: Duplicate subspace names are not allowed.',
|
||||||
style: TextStyle(color: Colors.red),
|
style: TextStyle(color: Colors.red),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user