mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-26 15:14:55 +00:00
Compare commits
26 Commits
SP-1478-FE
...
bugfix/cle
| Author | SHA1 | Date | |
|---|---|---|---|
| 58755eafe1 | |||
| ce225818fb | |||
| 8762a7aaa8 | |||
| 8dc833b2c3 | |||
| 13cef151aa | |||
| ab23be9828 | |||
| 687b68ab22 | |||
| 25614c3dd0 | |||
| 7cbe20ae88 | |||
| 349fe6c555 | |||
| 9779f3783c | |||
| fe3db663b6 | |||
| 888d444752 | |||
| bab5e06968 | |||
| d7b6174dee | |||
| 6ef0b2f9d1 | |||
| 3ceb03826e | |||
| 52608b1f35 | |||
| 34d4d892d9 | |||
| 3193fd26fe | |||
| 43802a9fad | |||
| 6e0b1775f0 | |||
| 233fb2ee2c | |||
| b26928b3d5 | |||
| 6fc35a7b9a | |||
| 756457927c |
@ -24,11 +24,10 @@ class FlushMountedPresenceSensorChangeValueEvent
|
|||||||
extends FlushMountedPresenceSensorEvent {
|
extends FlushMountedPresenceSensorEvent {
|
||||||
final int value;
|
final int value;
|
||||||
final String code;
|
final String code;
|
||||||
final bool isBatchControl;
|
|
||||||
const FlushMountedPresenceSensorChangeValueEvent({
|
const FlushMountedPresenceSensorChangeValueEvent({
|
||||||
required this.value,
|
required this.value,
|
||||||
required this.code,
|
required this.code,
|
||||||
this.isBatchControl = false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -75,7 +75,7 @@ class FlushMountedPresenceSensorBatchControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: (model.nearDetection / 100).toDouble(),
|
value: (model.nearDetection / 100).clamp(0.0, double.infinity),
|
||||||
title: 'Nearest Detect Dist:',
|
title: 'Nearest Detect Dist:',
|
||||||
description: 'm',
|
description: 'm',
|
||||||
minValue: 0.0,
|
minValue: 0.0,
|
||||||
@ -92,7 +92,7 @@ class FlushMountedPresenceSensorBatchControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: (model.farDetection / 100).toDouble(),
|
value: (model.farDetection / 100).clamp(0.0, double.infinity),
|
||||||
title: 'Max Detect Dist:',
|
title: 'Max Detect Dist:',
|
||||||
description: 'm',
|
description: 'm',
|
||||||
minValue: 0.0,
|
minValue: 0.0,
|
||||||
@ -109,7 +109,7 @@ class FlushMountedPresenceSensorBatchControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: model.presenceDelay.toDouble(),
|
value: model.sensiReduce.toDouble(),
|
||||||
title: 'Trigger Level:',
|
title: 'Trigger Level:',
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
maxValue: 3,
|
maxValue: 3,
|
||||||
@ -117,7 +117,7 @@ class FlushMountedPresenceSensorBatchControlView extends StatelessWidget
|
|||||||
action: (int value) => context.read<FlushMountedPresenceSensorBloc>().add(
|
action: (int value) => context.read<FlushMountedPresenceSensorBloc>().add(
|
||||||
FlushMountedPresenceSensorBatchControlEvent(
|
FlushMountedPresenceSensorBatchControlEvent(
|
||||||
deviceIds: devicesIds,
|
deviceIds: devicesIds,
|
||||||
code: FlushMountedPresenceSensorModel.codePresenceDelay,
|
code: FlushMountedPresenceSensorModel.codeSensiReduce,
|
||||||
value: value,
|
value: value,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -137,17 +137,19 @@ class FlushMountedPresenceSensorBatchControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: (model.sensiReduce.toDouble()),
|
value: (model.presenceDelay / 10).toDouble(),
|
||||||
title: 'Target Confirm Time:',
|
title: 'Target Confirm Time:',
|
||||||
description: 's',
|
description: 's',
|
||||||
minValue: 0,
|
minValue: 0.0,
|
||||||
maxValue: 3,
|
maxValue: 0.5,
|
||||||
steps: 1,
|
steps: 0.1,
|
||||||
action: (int value) => context.read<FlushMountedPresenceSensorBloc>().add(
|
valuesPercision: 1,
|
||||||
|
action: (double value) =>
|
||||||
|
context.read<FlushMountedPresenceSensorBloc>().add(
|
||||||
FlushMountedPresenceSensorBatchControlEvent(
|
FlushMountedPresenceSensorBatchControlEvent(
|
||||||
deviceIds: devicesIds,
|
deviceIds: devicesIds,
|
||||||
code: FlushMountedPresenceSensorModel.codeSensiReduce,
|
code: FlushMountedPresenceSensorModel.codePresenceDelay,
|
||||||
value: value,
|
value: (value * 10).toInt(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import 'package:syncrow_web/utils/helpers/responsice_layout_helper/responsive_la
|
|||||||
|
|
||||||
class FlushMountedPresenceSensorControlView extends StatelessWidget
|
class FlushMountedPresenceSensorControlView extends StatelessWidget
|
||||||
with HelperResponsiveLayout {
|
with HelperResponsiveLayout {
|
||||||
const FlushMountedPresenceSensorControlView({super.key, required this.device});
|
const FlushMountedPresenceSensorControlView({required this.device, super.key});
|
||||||
|
|
||||||
final AllDevicesModel device;
|
final AllDevicesModel device;
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ class FlushMountedPresenceSensorControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: (model.nearDetection / 100).toDouble(),
|
value: (model.nearDetection / 100).clamp(0.0, double.infinity),
|
||||||
title: 'Nearest Detect Dist:',
|
title: 'Nearest Detect Dist:',
|
||||||
description: 'm',
|
description: 'm',
|
||||||
minValue: 0.0,
|
minValue: 0.0,
|
||||||
@ -129,7 +129,7 @@ class FlushMountedPresenceSensorControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: (model.farDetection / 100).toDouble(),
|
value: (model.farDetection / 100).clamp(0.0, double.infinity),
|
||||||
title: 'Max Detect Dist:',
|
title: 'Max Detect Dist:',
|
||||||
description: 'm',
|
description: 'm',
|
||||||
minValue: 0.0,
|
minValue: 0.0,
|
||||||
@ -145,20 +145,20 @@ class FlushMountedPresenceSensorControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: (model.presenceDelay.toDouble()),
|
value: model.sensiReduce.toDouble(),
|
||||||
title: 'Trigger Level:',
|
title: 'Trigger Level:',
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
maxValue: 3,
|
maxValue: 3,
|
||||||
steps: 1,
|
steps: 1,
|
||||||
action: (int value) => context.read<FlushMountedPresenceSensorBloc>().add(
|
action: (int value) => context.read<FlushMountedPresenceSensorBloc>().add(
|
||||||
FlushMountedPresenceSensorChangeValueEvent(
|
FlushMountedPresenceSensorChangeValueEvent(
|
||||||
code: FlushMountedPresenceSensorModel.codePresenceDelay,
|
code: FlushMountedPresenceSensorModel.codeSensiReduce,
|
||||||
value: value,
|
value: value,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: (model.occurDistReduce.toDouble()),
|
value: model.occurDistReduce.toDouble(),
|
||||||
title: 'Indent Level:',
|
title: 'Indent Level:',
|
||||||
minValue: 0,
|
minValue: 0,
|
||||||
maxValue: 3,
|
maxValue: 3,
|
||||||
@ -171,21 +171,23 @@ class FlushMountedPresenceSensorControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: (model.sensiReduce.toDouble()),
|
value: (model.presenceDelay / 10).toDouble(),
|
||||||
|
valuesPercision: 1,
|
||||||
title: 'Target Confirm Time:',
|
title: 'Target Confirm Time:',
|
||||||
description: 's',
|
description: 's',
|
||||||
minValue: 0,
|
minValue: 0.0,
|
||||||
maxValue: 3,
|
maxValue: 0.5,
|
||||||
steps: 1,
|
steps: 0.1,
|
||||||
action: (int value) => context.read<FlushMountedPresenceSensorBloc>().add(
|
action: (double value) =>
|
||||||
|
context.read<FlushMountedPresenceSensorBloc>().add(
|
||||||
FlushMountedPresenceSensorChangeValueEvent(
|
FlushMountedPresenceSensorChangeValueEvent(
|
||||||
code: FlushMountedPresenceSensorModel.codeSensiReduce,
|
code: FlushMountedPresenceSensorModel.codePresenceDelay,
|
||||||
value: value,
|
value: (value * 10).toInt(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: ((model.noneDelay / 10).toDouble()),
|
value: (model.noneDelay / 10).toDouble(),
|
||||||
description: 's',
|
description: 's',
|
||||||
title: 'Disappe Delay:',
|
title: 'Disappe Delay:',
|
||||||
minValue: 20,
|
minValue: 20,
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:syncrow_web/pages/common/bloc/project_manager.dart';
|
import 'package:syncrow_web/pages/common/bloc/project_manager.dart';
|
||||||
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_bloc.dart';
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_bloc.dart';
|
||||||
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_event.dart';
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_event.dart';
|
||||||
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_state.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/create_subspace_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/create_subspace_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
|
||||||
@ -246,7 +247,9 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
final previousState = state;
|
final previousState = state;
|
||||||
final projectUuid = await ProjectManager.getProjectUUID() ?? '';
|
final projectUuid = await ProjectManager.getProjectUUID() ?? '';
|
||||||
var spaceBloc = event.context.read<SpaceTreeBloc>();
|
var spaceBloc = event.context.read<SpaceTreeBloc>();
|
||||||
List<CommunityModel> communities = await _waitForCommunityList(spaceBloc);
|
var spaceTreeState = event.context.read<SpaceTreeBloc>().state;
|
||||||
|
|
||||||
|
List<CommunityModel> communities = await _waitForCommunityList(spaceBloc, spaceTreeState);
|
||||||
await fetchSpaceModels();
|
await fetchSpaceModels();
|
||||||
await fetchTags();
|
await fetchTags();
|
||||||
|
|
||||||
@ -277,11 +280,13 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
LoadCommunityAndSpacesEvent event,
|
LoadCommunityAndSpacesEvent event,
|
||||||
Emitter<SpaceManagementState> emit,
|
Emitter<SpaceManagementState> emit,
|
||||||
) async {
|
) async {
|
||||||
|
var spaceTreeState = event.context.read<SpaceTreeBloc>().state;
|
||||||
var spaceBloc = event.context.read<SpaceTreeBloc>();
|
var spaceBloc = event.context.read<SpaceTreeBloc>();
|
||||||
|
|
||||||
_onloadProducts();
|
_onloadProducts();
|
||||||
await fetchTags();
|
await fetchTags();
|
||||||
// Wait until `communityList` is loaded
|
// Wait until `communityList` is loaded
|
||||||
List<CommunityModel> communities = await _waitForCommunityList(spaceBloc);
|
List<CommunityModel> communities = await _waitForCommunityList(spaceBloc, spaceTreeState);
|
||||||
|
|
||||||
// Fetch space models after communities are available
|
// Fetch space models after communities are available
|
||||||
final prevSpaceModels = await fetchSpaceModels();
|
final prevSpaceModels = await fetchSpaceModels();
|
||||||
@ -292,23 +297,38 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
allTags: _cachedTags ?? []));
|
allTags: _cachedTags ?? []));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<CommunityModel>> _waitForCommunityList(SpaceTreeBloc spaceBloc) async {
|
Future<List<CommunityModel>> _waitForCommunityList(
|
||||||
|
SpaceTreeBloc spaceBloc, SpaceTreeState spaceTreeState) async {
|
||||||
// Check if communityList is already populated
|
// Check if communityList is already populated
|
||||||
if (spaceBloc.state.communityList.isNotEmpty) {
|
final filteredCommunities = spaceTreeState.searchQuery.isNotEmpty
|
||||||
return spaceBloc.state.communityList;
|
? spaceTreeState.filteredCommunity
|
||||||
|
: spaceTreeState.communityList;
|
||||||
|
if (filteredCommunities.isNotEmpty) {
|
||||||
|
return filteredCommunities;
|
||||||
}
|
}
|
||||||
|
|
||||||
final completer = Completer<List<CommunityModel>>();
|
final completer = Completer<List<CommunityModel>>();
|
||||||
final subscription = spaceBloc.stream.listen((state) {
|
final subscription = spaceBloc.stream.listen((state) {
|
||||||
if (state.communityList.isNotEmpty) {
|
if (!completer.isCompleted && state.communityList.isNotEmpty) {
|
||||||
completer.complete(state.communityList);
|
completer
|
||||||
|
.complete(state.searchQuery.isNotEmpty ? state.filteredCommunity : state.communityList);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
try {
|
||||||
|
final communities = await completer.future.timeout(
|
||||||
|
const Duration(seconds: 10),
|
||||||
|
onTimeout: () {
|
||||||
|
if (!completer.isCompleted) {
|
||||||
|
completer.complete([]);
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
// Return the list once available, then cancel the listener
|
|
||||||
final communities = await completer.future;
|
|
||||||
await subscription.cancel();
|
|
||||||
return communities;
|
return communities;
|
||||||
|
} finally {
|
||||||
|
await subscription.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onCommunityDelete(
|
void _onCommunityDelete(
|
||||||
@ -446,6 +466,7 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
|
|
||||||
if (previousState is SpaceManagementLoaded) {
|
if (previousState is SpaceManagementLoaded) {
|
||||||
await _updateLoadedState(
|
await _updateLoadedState(
|
||||||
|
event.context,
|
||||||
previousState,
|
previousState,
|
||||||
allSpaces,
|
allSpaces,
|
||||||
event.communityUuid,
|
event.communityUuid,
|
||||||
@ -462,6 +483,7 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _updateLoadedState(
|
Future<void> _updateLoadedState(
|
||||||
|
BuildContext context,
|
||||||
SpaceManagementLoaded previousState,
|
SpaceManagementLoaded previousState,
|
||||||
List<SpaceModel> allSpaces,
|
List<SpaceModel> allSpaces,
|
||||||
String communityUuid,
|
String communityUuid,
|
||||||
@ -469,7 +491,10 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
) async {
|
) async {
|
||||||
var prevSpaceModels = await fetchSpaceModels();
|
var prevSpaceModels = await fetchSpaceModels();
|
||||||
await fetchTags();
|
await fetchTags();
|
||||||
final communities = List<CommunityModel>.from(previousState.communities);
|
final spaceTreeState = context.read<SpaceTreeBloc>().state;
|
||||||
|
final communities = spaceTreeState.searchQuery.isNotEmpty
|
||||||
|
? spaceTreeState.filteredCommunity
|
||||||
|
: spaceTreeState.communityList;
|
||||||
|
|
||||||
for (var community in communities) {
|
for (var community in communities) {
|
||||||
if (community.uuid == communityUuid) {
|
if (community.uuid == communityUuid) {
|
||||||
@ -484,6 +509,8 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
spaceModels: prevSpaceModels,
|
spaceModels: prevSpaceModels,
|
||||||
allTags: _cachedTags ?? []));
|
allTags: _cachedTags ?? []));
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
print("Community not found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -491,12 +518,21 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
Future<List<SpaceModel>> saveSpacesHierarchically(
|
Future<List<SpaceModel>> saveSpacesHierarchically(
|
||||||
BuildContext context, List<SpaceModel> spaces, String communityUuid) async {
|
BuildContext context, List<SpaceModel> spaces, String communityUuid) async {
|
||||||
final orderedSpaces = flattenHierarchy(spaces);
|
final orderedSpaces = flattenHierarchy(spaces);
|
||||||
|
|
||||||
final projectUuid = await ProjectManager.getProjectUUID() ?? '';
|
final projectUuid = await ProjectManager.getProjectUUID() ?? '';
|
||||||
var spaceBloc = context.read<SpaceTreeBloc>();
|
CommunityModel? selectedCommunity;
|
||||||
List<CommunityModel> communities = spaceBloc.state.communityList;
|
try {
|
||||||
CommunityModel? selectedCommunity = communities.firstWhere(
|
final spaceTreeState = context.read<SpaceTreeBloc>().state;
|
||||||
|
final filteredCommunities = spaceTreeState.searchQuery.isNotEmpty
|
||||||
|
? spaceTreeState.filteredCommunity
|
||||||
|
: spaceTreeState.communityList;
|
||||||
|
|
||||||
|
selectedCommunity = filteredCommunities.firstWhere(
|
||||||
(community) => community.uuid == communityUuid,
|
(community) => community.uuid == communityUuid,
|
||||||
);
|
);
|
||||||
|
} catch (e) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
final parentsToDelete = orderedSpaces.where((space) =>
|
final parentsToDelete = orderedSpaces.where((space) =>
|
||||||
space.status == SpaceStatus.deleted &&
|
space.status == SpaceStatus.deleted &&
|
||||||
@ -605,11 +641,11 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
projectId: projectUuid);
|
projectId: projectUuid);
|
||||||
} else {
|
} else {
|
||||||
// Call create if the space does not have a UUID
|
// Call create if the space does not have a UUID
|
||||||
final List<CreateTagBodyModel> tagBodyModels = space.tags != null
|
List<CreateTagBodyModel> tagBodyModels = space.tags != null
|
||||||
? space.tags!.map((tag) => tag.toCreateTagBodyModel()).toList()
|
? space.tags!.map((tag) => tag.toCreateTagBodyModel()).toList()
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
final createSubspaceBodyModels = space.subspaces?.map((subspace) {
|
var createSubspaceBodyModels = space.subspaces?.map((subspace) {
|
||||||
final tagBodyModels =
|
final tagBodyModels =
|
||||||
subspace.tags?.map((tag) => tag.toCreateTagBodyModel()).toList() ?? [];
|
subspace.tags?.map((tag) => tag.toCreateTagBodyModel()).toList() ?? [];
|
||||||
return CreateSubspaceModel()
|
return CreateSubspaceModel()
|
||||||
@ -618,6 +654,11 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
}).toList() ??
|
}).toList() ??
|
||||||
[];
|
[];
|
||||||
|
|
||||||
|
if (space.spaceModel?.uuid != null) {
|
||||||
|
tagBodyModels = [];
|
||||||
|
createSubspaceBodyModels = [];
|
||||||
|
}
|
||||||
|
|
||||||
final response = await _api.createSpace(
|
final response = await _api.createSpace(
|
||||||
communityId: communityUuid,
|
communityId: communityUuid,
|
||||||
name: space.name,
|
name: space.name,
|
||||||
@ -669,9 +710,12 @@ class SpaceManagementBloc extends Bloc<SpaceManagementEvent, SpaceManagementStat
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await fetchTags();
|
await fetchTags();
|
||||||
final projectUuid = await ProjectManager.getProjectUUID() ?? '';
|
final spaceTreeState = event.context.read<SpaceTreeBloc>().state;
|
||||||
var spaceBloc = event.context.read<SpaceTreeBloc>();
|
final filteredCommunities = spaceTreeState.searchQuery.isNotEmpty
|
||||||
List<CommunityModel> communities = spaceBloc.state.communityList;
|
? spaceTreeState.filteredCommunity
|
||||||
|
: spaceTreeState.communityList;
|
||||||
|
|
||||||
|
List<CommunityModel> communities = filteredCommunities;
|
||||||
|
|
||||||
var prevSpaceModels = await fetchSpaceModels();
|
var prevSpaceModels = await fetchSpaceModels();
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,8 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
_nameController = TextEditingController(
|
_nameController = TextEditingController(
|
||||||
text: widget.selectedCommunity?.name ?? '',
|
text: widget.selectedCommunity?.name ?? '',
|
||||||
);
|
);
|
||||||
|
realignTree();
|
||||||
|
|
||||||
_transformationController = TransformationController();
|
_transformationController = TransformationController();
|
||||||
if (widget.selectedSpace != null) {
|
if (widget.selectedSpace != null) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
@ -96,6 +98,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
spaces = widget.spaces.isNotEmpty ? flattenSpaces(widget.spaces) : [];
|
spaces = widget.spaces.isNotEmpty ? flattenSpaces(widget.spaces) : [];
|
||||||
connections = widget.spaces.isNotEmpty ? createConnections(widget.spaces) : [];
|
connections = widget.spaces.isNotEmpty ? createConnections(widget.spaces) : [];
|
||||||
_adjustCanvasSizeForSpaces();
|
_adjustCanvasSizeForSpaces();
|
||||||
|
realignTree();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,21 +407,31 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
|
|
||||||
List<SpaceModel> flattenSpaces(List<SpaceModel> spaces) {
|
List<SpaceModel> flattenSpaces(List<SpaceModel> spaces) {
|
||||||
List<SpaceModel> result = [];
|
List<SpaceModel> result = [];
|
||||||
|
Map<String, SpaceModel> idToSpace = {};
|
||||||
|
|
||||||
void flatten(SpaceModel space) {
|
void flatten(SpaceModel space) {
|
||||||
if (space.status == SpaceStatus.deleted || space.status == SpaceStatus.parentDeleted) {
|
if (space.status == SpaceStatus.deleted || space.status == SpaceStatus.parentDeleted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result.add(space);
|
result.add(space);
|
||||||
|
idToSpace[space.internalId] = space;
|
||||||
|
|
||||||
for (var child in space.children) {
|
for (var child in space.children) {
|
||||||
flatten(child);
|
flatten(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (var space in spaces) {
|
for (var space in spaces) {
|
||||||
flatten(space);
|
flatten(space);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (var space in result) {
|
||||||
|
if (space.parent != null) {
|
||||||
|
space.parent = idToSpace[space.parent!.internalId];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,7 +480,6 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String communityUuid = widget.selectedCommunity!.uuid;
|
String communityUuid = widget.selectedCommunity!.uuid;
|
||||||
|
|
||||||
context.read<SpaceManagementBloc>().add(SaveSpacesEvent(
|
context.read<SpaceManagementBloc>().add(SaveSpacesEvent(
|
||||||
context,
|
context,
|
||||||
spaces: spacesToSave,
|
spaces: spacesToSave,
|
||||||
@ -696,7 +708,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
final double verticalGap = 180.0;
|
final double verticalGap = 180.0;
|
||||||
final double nodeWidth = 200;
|
final double nodeWidth = 200;
|
||||||
final double nodeHeight = 100;
|
final double nodeHeight = 100;
|
||||||
final double breathingSpace = 300.0; // extra gap after original tree
|
final double breathingSpace = 300.0;
|
||||||
|
|
||||||
/// Helper to recursively duplicate a node and its children
|
/// Helper to recursively duplicate a node and its children
|
||||||
SpaceModel duplicateRecursive(SpaceModel original, SpaceModel? duplicatedParent) {
|
SpaceModel duplicateRecursive(SpaceModel original, SpaceModel? duplicatedParent) {
|
||||||
@ -704,7 +716,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
final duplicated = SpaceModel(
|
final duplicated = SpaceModel(
|
||||||
name: duplicatedName,
|
name: duplicatedName,
|
||||||
icon: original.icon,
|
icon: original.icon,
|
||||||
position: Offset.zero,
|
position: original.position,
|
||||||
isPrivate: original.isPrivate,
|
isPrivate: original.isPrivate,
|
||||||
children: [],
|
children: [],
|
||||||
status: SpaceStatus.newSpace,
|
status: SpaceStatus.newSpace,
|
||||||
@ -723,11 +735,13 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
direction: "down",
|
direction: "down",
|
||||||
);
|
);
|
||||||
connections.add(newConnection);
|
connections.add(newConnection);
|
||||||
|
|
||||||
duplicated.incomingConnection = newConnection;
|
duplicated.incomingConnection = newConnection;
|
||||||
duplicatedParent.addOutgoingConnection(newConnection);
|
duplicatedParent.addOutgoingConnection(newConnection);
|
||||||
duplicatedParent.children.add(duplicated);
|
duplicatedParent.children.add(duplicated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Duplicate its children recursively
|
||||||
for (var child in original.children) {
|
for (var child in original.children) {
|
||||||
duplicateRecursive(child, duplicated);
|
duplicateRecursive(child, duplicated);
|
||||||
}
|
}
|
||||||
@ -735,48 +749,29 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
return duplicated;
|
return duplicated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Layout a subtree rooted at node
|
|
||||||
void layoutSubtree(SpaceModel node, double startX, double startY) {
|
|
||||||
double calculateSubtreeWidth(SpaceModel n) {
|
|
||||||
if (n.children.isEmpty) return nodeWidth;
|
|
||||||
double width = 0;
|
|
||||||
for (var child in n.children) {
|
|
||||||
width += calculateSubtreeWidth(child) + horizontalGap;
|
|
||||||
}
|
|
||||||
return width - horizontalGap;
|
|
||||||
}
|
|
||||||
|
|
||||||
void assignPositions(SpaceModel n, double x, double y) {
|
|
||||||
double subtreeWidth = calculateSubtreeWidth(n);
|
|
||||||
double centerX = x + subtreeWidth / 2 - nodeWidth / 2;
|
|
||||||
n.position = Offset(centerX, y);
|
|
||||||
|
|
||||||
if (n.children.length == 1) {
|
|
||||||
assignPositions(n.children.first, centerX, y + verticalGap);
|
|
||||||
} else {
|
|
||||||
double childX = x;
|
|
||||||
for (var child in n.children) {
|
|
||||||
double childWidth = calculateSubtreeWidth(child);
|
|
||||||
assignPositions(child, childX, y + verticalGap);
|
|
||||||
childX += childWidth + horizontalGap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double totalSubtreeWidth = calculateSubtreeWidth(node);
|
|
||||||
assignPositions(node, startX, startY);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Actual duplication process
|
/// Actual duplication process
|
||||||
setState(() {
|
setState(() {
|
||||||
if (space.parent == null) {
|
if (space.parent == null) {
|
||||||
// Duplicating a ROOT node
|
// Duplicating a ROOT node
|
||||||
SpaceModel duplicatedRoot = duplicateRecursive(space, null);
|
duplicateRecursive(space, null);
|
||||||
|
connections = createConnections(spaces);
|
||||||
realignTree();
|
realignTree();
|
||||||
} else {
|
} else {
|
||||||
// Duplicating a CHILD node inside its parent
|
final parent = space.parent!;
|
||||||
SpaceModel duplicated = duplicateRecursive(space, space.parent);
|
|
||||||
|
final duplicated = duplicateRecursive(space, parent);
|
||||||
|
final newConnection = Connection(
|
||||||
|
startSpace: parent,
|
||||||
|
endSpace: duplicated,
|
||||||
|
direction: "down",
|
||||||
|
);
|
||||||
|
connections.add(newConnection);
|
||||||
|
duplicated.incomingConnection = newConnection;
|
||||||
|
parent.addOutgoingConnection(newConnection);
|
||||||
|
parent.children.add(duplicated);
|
||||||
|
connections = createConnections(spaces);
|
||||||
realignTree();
|
realignTree();
|
||||||
|
//_realignSubtree(space.parent!);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_bloc.dart';
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_bloc.dart';
|
||||||
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_event.dart';
|
||||||
import 'package:syncrow_web/pages/space_tree/view/space_tree_view.dart';
|
import 'package:syncrow_web/pages/space_tree/view/space_tree_view.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/bloc/space_management_bloc.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/bloc/space_management_bloc.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/bloc/space_management_event.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/bloc/space_management_event.dart';
|
||||||
@ -45,7 +46,6 @@ class _LoadedSpaceViewState extends State<LoadedSpaceView> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
_spaceModels = List.from(widget.spaceModels ?? []);
|
_spaceModels = List.from(widget.spaceModels ?? []);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,9 +106,8 @@ class _LoadedSpaceViewState extends State<LoadedSpaceView> {
|
|||||||
children: [
|
children: [
|
||||||
SidebarWidget(
|
SidebarWidget(
|
||||||
communities: widget.communities,
|
communities: widget.communities,
|
||||||
selectedSpaceUuid: widget.selectedSpace?.uuid ??
|
selectedSpaceUuid:
|
||||||
widget.selectedCommunity?.uuid ??
|
widget.selectedSpace?.uuid ?? widget.selectedCommunity?.uuid ?? '',
|
||||||
'',
|
|
||||||
onCreateCommunity: (name, description) {
|
onCreateCommunity: (name, description) {
|
||||||
context.read<SpaceManagementBloc>().add(
|
context.read<SpaceManagementBloc>().add(
|
||||||
CreateCommunityEvent(name, description, context),
|
CreateCommunityEvent(name, description, context),
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:syncrow_web/common/widgets/empty_search_result_widget.dart';
|
import 'package:syncrow_web/common/widgets/empty_search_result_widget.dart';
|
||||||
@ -36,6 +38,7 @@ class SidebarWidget extends StatefulWidget {
|
|||||||
|
|
||||||
class _SidebarWidgetState extends State<SidebarWidget> {
|
class _SidebarWidgetState extends State<SidebarWidget> {
|
||||||
late final ScrollController _scrollController;
|
late final ScrollController _scrollController;
|
||||||
|
Timer? _debounce;
|
||||||
|
|
||||||
String _searchQuery = '';
|
String _searchQuery = '';
|
||||||
String? _selectedSpaceUuid;
|
String? _selectedSpaceUuid;
|
||||||
@ -43,10 +46,12 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
super.initState();
|
||||||
_scrollController = ScrollController();
|
_scrollController = ScrollController();
|
||||||
_scrollController.addListener(_onScroll);
|
_scrollController.addListener(_onScroll);
|
||||||
_selectedId = widget.selectedSpaceUuid;
|
_selectedId = widget.selectedSpaceUuid;
|
||||||
super.initState();
|
_searchQuery = '';
|
||||||
|
context.read<SpaceTreeBloc>().add(ClearCachedData());
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onScroll() {
|
void _onScroll() {
|
||||||
@ -67,11 +72,22 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_scrollController.removeListener(_onScroll);
|
_scrollController.removeListener(_onScroll);
|
||||||
|
|
||||||
_scrollController.dispose();
|
_scrollController.dispose();
|
||||||
|
_debounce?.cancel();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _onSearchChanged(String query) {
|
||||||
|
if (_debounce?.isActive ?? false) _debounce?.cancel();
|
||||||
|
|
||||||
|
_debounce = Timer(const Duration(milliseconds: 500), () {
|
||||||
|
setState(() {
|
||||||
|
_searchQuery = query;
|
||||||
|
});
|
||||||
|
context.read<SpaceTreeBloc>().add(SearchQueryEvent(query));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didUpdateWidget(covariant SidebarWidget oldWidget) {
|
void didUpdateWidget(covariant SidebarWidget oldWidget) {
|
||||||
if (widget.selectedSpaceUuid != oldWidget.selectedSpaceUuid) {
|
if (widget.selectedSpaceUuid != oldWidget.selectedSpaceUuid) {
|
||||||
@ -91,7 +107,7 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final spaceTreeState = context.watch<SpaceTreeBloc>().state;
|
final spaceTreeState = context.watch<SpaceTreeBloc>().state;
|
||||||
final filteredCommunities = spaceTreeState.isSearching
|
final filteredCommunities = spaceTreeState.searchQuery.isNotEmpty
|
||||||
? spaceTreeState.filteredCommunity
|
? spaceTreeState.filteredCommunity
|
||||||
: spaceTreeState.communityList;
|
: spaceTreeState.communityList;
|
||||||
|
|
||||||
@ -104,13 +120,7 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
children: [
|
children: [
|
||||||
SidebarHeader(onAddCommunity: _onAddCommunity),
|
SidebarHeader(onAddCommunity: _onAddCommunity),
|
||||||
CustomSearchBar(
|
CustomSearchBar(
|
||||||
onSearchChanged: (query) {
|
onSearchChanged: _onSearchChanged,
|
||||||
setState(() {
|
|
||||||
_searchQuery = query;
|
|
||||||
});
|
|
||||||
|
|
||||||
context.read<SpaceTreeBloc>().add(SearchQueryEvent(query));
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -123,10 +133,15 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
communities: filteredCommunities,
|
communities: filteredCommunities,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (index == filteredCommunities.length) {
|
if (index == filteredCommunities.length) {
|
||||||
|
final spaceTreeState = context.read<SpaceTreeBloc>().state;
|
||||||
|
if (spaceTreeState.paginationIsLoading) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.all(8.0),
|
padding: EdgeInsets.all(8.0),
|
||||||
child: Center(child: CircularProgressIndicator()),
|
child: Center(child: CircularProgressIndicator()),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return _buildCommunityTile(context, filteredCommunities[index]);
|
return _buildCommunityTile(context, filteredCommunities[index]);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_bloc.dart';
|
||||||
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_event.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/tag.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/tag.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_bloc.dart';
|
import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_bloc.dart';
|
||||||
@ -27,6 +29,8 @@ class SpaceModelPage extends StatelessWidget {
|
|||||||
return const Center(child: CircularProgressIndicator());
|
return const Center(child: CircularProgressIndicator());
|
||||||
} else if (state is SpaceModelLoaded) {
|
} else if (state is SpaceModelLoaded) {
|
||||||
final spaceModels = state.spaceModels;
|
final spaceModels = state.spaceModels;
|
||||||
|
context.read<SpaceTreeBloc>().add(ClearCachedData());
|
||||||
|
|
||||||
final allTagValues = _getAllTagValues(spaceModels);
|
final allTagValues = _getAllTagValues(spaceModels);
|
||||||
final allSpaceModelNames = _getAllSpaceModelName(spaceModels);
|
final allSpaceModelNames = _getAllSpaceModelName(spaceModels);
|
||||||
|
|
||||||
|
|||||||
@ -46,14 +46,14 @@ final class DebouncedBatchControlDevicesService
|
|||||||
final BatchControlDevicesService decoratee;
|
final BatchControlDevicesService decoratee;
|
||||||
final Duration debounceDuration;
|
final Duration debounceDuration;
|
||||||
|
|
||||||
final _pendingRequests = <(List<String> uuids, String code, Object value)>[];
|
|
||||||
var _isProcessing = false;
|
|
||||||
|
|
||||||
DebouncedBatchControlDevicesService({
|
DebouncedBatchControlDevicesService({
|
||||||
required this.decoratee,
|
required this.decoratee,
|
||||||
this.debounceDuration = const Duration(milliseconds: 800),
|
this.debounceDuration = const Duration(milliseconds: 1500),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final _pendingRequests = <(List<String> uuids, String code, Object value)>[];
|
||||||
|
var _isProcessing = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> batchControlDevices({
|
Future<bool> batchControlDevices({
|
||||||
required List<String> uuids,
|
required List<String> uuids,
|
||||||
@ -68,16 +68,26 @@ final class DebouncedBatchControlDevicesService
|
|||||||
|
|
||||||
await Future.delayed(debounceDuration);
|
await Future.delayed(debounceDuration);
|
||||||
|
|
||||||
final lastRequest = _pendingRequests.last;
|
final groupedRequests =
|
||||||
|
<String, (List<String> uuids, String code, Object value)>{};
|
||||||
|
for (final request in _pendingRequests) {
|
||||||
|
final (_, requestCode, requestValue) = request;
|
||||||
|
groupedRequests[requestCode] = request;
|
||||||
|
}
|
||||||
_pendingRequests.clear();
|
_pendingRequests.clear();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final (lastRequestUuids, lastRequestCode, lastRequestValue) = lastRequest;
|
var allSuccessful = true;
|
||||||
return decoratee.batchControlDevices(
|
for (final request in groupedRequests.values) {
|
||||||
|
final (lastRequestUuids, lastRequestCode, lastRequestValue) = request;
|
||||||
|
final success = await decoratee.batchControlDevices(
|
||||||
uuids: lastRequestUuids,
|
uuids: lastRequestUuids,
|
||||||
code: lastRequestCode,
|
code: lastRequestCode,
|
||||||
value: lastRequestValue,
|
value: lastRequestValue,
|
||||||
);
|
);
|
||||||
|
if (!success) allSuccessful = false;
|
||||||
|
}
|
||||||
|
return allSuccessful;
|
||||||
} finally {
|
} finally {
|
||||||
_isProcessing = false;
|
_isProcessing = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ final class DebouncedControlDeviceService implements ControlDeviceService {
|
|||||||
|
|
||||||
DebouncedControlDeviceService({
|
DebouncedControlDeviceService({
|
||||||
required this.decoratee,
|
required this.decoratee,
|
||||||
this.debounceDuration = const Duration(milliseconds: 800),
|
this.debounceDuration = const Duration(milliseconds: 1500),
|
||||||
});
|
});
|
||||||
|
|
||||||
final _pendingRequests = <(String deviceUuid, Status status)>[];
|
final _pendingRequests = <(String deviceUuid, Status status)>[];
|
||||||
@ -59,15 +59,24 @@ final class DebouncedControlDeviceService implements ControlDeviceService {
|
|||||||
|
|
||||||
await Future.delayed(debounceDuration);
|
await Future.delayed(debounceDuration);
|
||||||
|
|
||||||
final lastRequest = _pendingRequests.last;
|
final groupedRequests = <String, (String deviceUuid, Status status)>{};
|
||||||
|
for (final request in _pendingRequests) {
|
||||||
|
final (_, requestStatus) = request;
|
||||||
|
groupedRequests[requestStatus.code] = request;
|
||||||
|
}
|
||||||
_pendingRequests.clear();
|
_pendingRequests.clear();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final (lastRequestDeviceUuid, lastRequestStatus) = lastRequest;
|
var allSuccessful = true;
|
||||||
return decoratee.controlDevice(
|
for (final request in groupedRequests.values) {
|
||||||
|
final (lastRequestDeviceUuid, lastRequestStatus) = request;
|
||||||
|
final success = await decoratee.controlDevice(
|
||||||
deviceUuid: lastRequestDeviceUuid,
|
deviceUuid: lastRequestDeviceUuid,
|
||||||
status: lastRequestStatus,
|
status: lastRequestStatus,
|
||||||
);
|
);
|
||||||
|
if (!success) allSuccessful = false;
|
||||||
|
}
|
||||||
|
return allSuccessful;
|
||||||
} finally {
|
} finally {
|
||||||
_isProcessing = false;
|
_isProcessing = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -281,6 +281,7 @@ class CommunitySpaceManagementApi {
|
|||||||
return json['success'] ?? false;
|
return json['success'] ?? false;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('Error updating space: $e');
|
debugPrint('Error updating space: $e');
|
||||||
|
|||||||
Reference in New Issue
Block a user