add device type comes from products

This commit is contained in:
hannathkadher
2024-11-20 20:10:39 +04:00
parent bf0dc7b56c
commit 9affae0269
11 changed files with 256 additions and 95 deletions

View File

@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_web/pages/common/buttons/add_space_button.dart';
import 'package:syncrow_web/pages/spaces_management/bloc/space_management_bloc.dart';
import 'package:syncrow_web/pages/spaces_management/bloc/space_management_event.dart';
import 'package:syncrow_web/pages/spaces_management/model/product_model.dart';
import 'package:syncrow_web/pages/spaces_management/model/space_model.dart';
import 'package:syncrow_web/pages/spaces_management/view/dialogs/create_space_dialog.dart';
import 'package:syncrow_web/pages/spaces_management/widgets/curved_line_painter.dart';
@ -15,6 +16,7 @@ import 'package:syncrow_web/utils/color_manager.dart';
class CommunityStructureArea extends StatefulWidget {
final CommunityModel? selectedCommunity;
final SpaceModel? selectedSpace;
final List<ProductModel>? products;
final List<SpaceModel> spaces;
final List<Connection> connections;
@ -22,6 +24,7 @@ class CommunityStructureArea extends StatefulWidget {
CommunityStructureArea({
this.selectedCommunity,
this.selectedSpace,
this.products,
required this.spaces,
required this.connections,
});
@ -236,6 +239,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
context: context,
builder: (BuildContext context) {
return CreateSpaceDialog(
products: widget.products,
onCreateSpace: (String name, String icon) {
setState(() {
// Set the first space in the center or use passed position