mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
85 lines
1.9 KiB
Dart
85 lines
1.9 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_web/pages/spaces_management/model/space_model.dart'; // Import for Offset
|
|
|
|
abstract class SpaceManagementEvent extends Equatable {
|
|
const SpaceManagementEvent();
|
|
|
|
@override
|
|
List<Object> get props => [];
|
|
}
|
|
|
|
class LoadCommunityAndSpacesEvent extends SpaceManagementEvent {}
|
|
|
|
class CreateSpaceEvent extends SpaceManagementEvent {
|
|
final String name;
|
|
final String icon;
|
|
final Offset position;
|
|
final int? parentIndex;
|
|
final String? direction;
|
|
|
|
const CreateSpaceEvent({
|
|
required this.name,
|
|
required this.icon,
|
|
required this.position,
|
|
this.parentIndex,
|
|
this.direction,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [
|
|
name,
|
|
icon,
|
|
position,
|
|
parentIndex ?? -1, // Use a fallback value if nullable
|
|
direction ?? '', // Use a fallback value if nullable
|
|
];
|
|
}
|
|
|
|
class SaveSpacesEvent extends SpaceManagementEvent {
|
|
final List<SpaceModel> spaces;
|
|
final String communityUuid;
|
|
|
|
const SaveSpacesEvent({
|
|
required this.spaces,
|
|
required this.communityUuid,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [spaces, communityUuid];
|
|
}
|
|
|
|
class UpdateSpacePositionEvent extends SpaceManagementEvent {
|
|
final int index;
|
|
final Offset newPosition;
|
|
|
|
const UpdateSpacePositionEvent(this.index, this.newPosition);
|
|
|
|
@override
|
|
List<Object> get props => [index, newPosition];
|
|
}
|
|
|
|
class CreateCommunityEvent extends SpaceManagementEvent {
|
|
final String name;
|
|
final String description;
|
|
final String regionId;
|
|
|
|
const CreateCommunityEvent({
|
|
required this.name,
|
|
required this.description,
|
|
required this.regionId,
|
|
});
|
|
|
|
@override
|
|
List<Object> get props => [name, description, regionId];
|
|
}
|
|
|
|
|
|
class LoadSpaceHierarchyEvent extends SpaceManagementEvent {
|
|
final String communityId;
|
|
|
|
const LoadSpaceHierarchyEvent({required this.communityId});
|
|
|
|
@override
|
|
List<Object> get props => [communityId];
|
|
} |