mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-14 17:25:50 +00:00
add device type comes from products
This commit is contained in:
@ -5,9 +5,11 @@ import 'package:syncrow_web/pages/spaces_management/bloc/space_management_event.
|
||||
import 'package:syncrow_web/pages/spaces_management/bloc/space_management_state.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/community_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/connection_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/product_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/space_data_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/space_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/widgets/loaded_space_widget.dart';
|
||||
import 'package:syncrow_web/services/product_api.dart';
|
||||
import 'package:syncrow_web/services/space_mana_api.dart';
|
||||
import 'package:syncrow_web/web_layout/web_scaffold.dart';
|
||||
|
||||
@ -22,11 +24,14 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
|
||||
CommunityModel? selectedCommunity;
|
||||
SpaceModel? selectedSpace;
|
||||
final CommunitySpaceManagementApi _api = CommunitySpaceManagementApi();
|
||||
final ProductApi _productApi = ProductApi();
|
||||
Map<String, List<SpaceModel>> communitySpaces = {};
|
||||
double canvasWidth = 1000;
|
||||
double canvasHeight = 1000;
|
||||
List<SpaceData> spaces = [];
|
||||
List<Connection> connections = [];
|
||||
List<ProductModel> products = [];
|
||||
bool isProductDataLoaded = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -37,7 +42,7 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) =>
|
||||
SpaceManagementBloc(CommunitySpaceManagementApi())..add(LoadCommunityAndSpacesEvent()),
|
||||
SpaceManagementBloc(_api, _productApi)..add(LoadCommunityAndSpacesEvent()),
|
||||
child: WebScaffold(
|
||||
appBarTitle: Text('Space Management', style: Theme.of(context).textTheme.headlineLarge),
|
||||
enableMenuSidebar: false,
|
||||
@ -57,6 +62,7 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
|
||||
communities: state.communities,
|
||||
selectedCommunity: selectedCommunity,
|
||||
selectedSpace: selectedSpace,
|
||||
products:state.products,
|
||||
onCommunitySelected: (community) {
|
||||
setState(() {
|
||||
selectedCommunity = community;
|
||||
|
Reference in New Issue
Block a user