mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-15 09:45:25 +00:00
fixed space creation api
This commit is contained in:
@ -107,7 +107,9 @@ class AddDeviceTypeWidget extends StatelessWidget {
|
|||||||
spaceName: spaceName,
|
spaceName: spaceName,
|
||||||
initialTags: initialTags,
|
initialTags: initialTags,
|
||||||
title: dialogTitle,
|
title: dialogTitle,
|
||||||
onSave: onSave,
|
onSave: (tags,subspaces){
|
||||||
|
onSave!(tags,subspaces);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.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/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/space_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_model.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';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/bloc/space_management_state.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/bloc/space_management_state.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/tag.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/create_space_template_body_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/space_model/models/space_template_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/space_template_model.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/tag_body_model.dart';
|
||||||
import 'package:syncrow_web/services/product_api.dart';
|
import 'package:syncrow_web/services/product_api.dart';
|
||||||
import 'package:syncrow_web/services/space_mana_api.dart';
|
import 'package:syncrow_web/services/space_mana_api.dart';
|
||||||
import 'package:syncrow_web/services/space_model_mang_api.dart';
|
import 'package:syncrow_web/services/space_model_mang_api.dart';
|
||||||
@ -343,7 +347,7 @@ class SpaceManagementBloc
|
|||||||
emit(SpaceCreationSuccess(spaces: updatedSpaces));
|
emit(SpaceCreationSuccess(spaces: updatedSpaces));
|
||||||
|
|
||||||
if (previousState is SpaceManagementLoaded) {
|
if (previousState is SpaceManagementLoaded) {
|
||||||
_updateLoadedState(
|
await _updateLoadedState(
|
||||||
previousState,
|
previousState,
|
||||||
allSpaces,
|
allSpaces,
|
||||||
event.communityUuid,
|
event.communityUuid,
|
||||||
@ -361,12 +365,14 @@ class SpaceManagementBloc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _updateLoadedState(
|
Future<void> _updateLoadedState(
|
||||||
SpaceManagementLoaded previousState,
|
SpaceManagementLoaded previousState,
|
||||||
List<SpaceModel> allSpaces,
|
List<SpaceModel> allSpaces,
|
||||||
String communityUuid,
|
String communityUuid,
|
||||||
Emitter<SpaceManagementState> emit,
|
Emitter<SpaceManagementState> emit,
|
||||||
) {
|
) async {
|
||||||
|
var prevSpaceModels = await fetchSpaceModels(previousState);
|
||||||
|
|
||||||
final communities = List<CommunityModel>.from(previousState.communities);
|
final communities = List<CommunityModel>.from(previousState.communities);
|
||||||
|
|
||||||
for (var community in communities) {
|
for (var community in communities) {
|
||||||
@ -377,7 +383,7 @@ class SpaceManagementBloc
|
|||||||
products: _cachedProducts ?? [],
|
products: _cachedProducts ?? [],
|
||||||
selectedCommunity: community,
|
selectedCommunity: community,
|
||||||
selectedSpace: null,
|
selectedSpace: null,
|
||||||
));
|
spaceModels: prevSpaceModels));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -416,6 +422,21 @@ class SpaceManagementBloc
|
|||||||
);
|
);
|
||||||
} 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
|
||||||
|
? space.tags!.map((tag) => tag.toCreateTagBodyModel()).toList()
|
||||||
|
: [];
|
||||||
|
|
||||||
|
final createSubspaceBodyModels = space.subspaces?.map((subspace) {
|
||||||
|
final tagBodyModels = subspace.tags
|
||||||
|
?.map((tag) => tag.toCreateTagBodyModel())
|
||||||
|
.toList() ??
|
||||||
|
[];
|
||||||
|
return CreateSubspaceModel()
|
||||||
|
..subspaceName = subspace.subspaceName
|
||||||
|
..tags = tagBodyModels;
|
||||||
|
}).toList() ??
|
||||||
|
[];
|
||||||
|
|
||||||
final response = await _api.createSpace(
|
final response = await _api.createSpace(
|
||||||
communityId: communityUuid,
|
communityId: communityUuid,
|
||||||
name: space.name,
|
name: space.name,
|
||||||
@ -424,6 +445,9 @@ class SpaceManagementBloc
|
|||||||
position: space.position,
|
position: space.position,
|
||||||
icon: space.icon,
|
icon: space.icon,
|
||||||
direction: space.incomingConnection?.direction,
|
direction: space.incomingConnection?.direction,
|
||||||
|
spaceModelUuid: space.spaceModel?.uuid,
|
||||||
|
tags: tagBodyModels,
|
||||||
|
subspaces: createSubspaceBodyModels,
|
||||||
);
|
);
|
||||||
space.uuid = response?.uuid;
|
space.uuid = response?.uuid;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/tag_body_model.dart';
|
||||||
|
|
||||||
|
class CreateSubspaceModel {
|
||||||
|
late String subspaceName;
|
||||||
|
late List<CreateTagBodyModel>? tags;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return {
|
||||||
|
'subspaceName': subspaceName,
|
||||||
|
'tags': tags?.map((tag) => tag.toJson()).toList(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@ -24,7 +24,7 @@ class SpaceModel {
|
|||||||
SpaceStatus status;
|
SpaceStatus status;
|
||||||
String internalId;
|
String internalId;
|
||||||
SpaceTemplateModel? spaceModel;
|
SpaceTemplateModel? spaceModel;
|
||||||
final List<Tag>? tags;
|
List<Tag>? tags;
|
||||||
List<SubspaceModel>? subspaces;
|
List<SubspaceModel>? subspaces;
|
||||||
|
|
||||||
List<Connection> outgoingConnections = []; // Connections from this space
|
List<Connection> outgoingConnections = []; // Connections from this space
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
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/space_model/models/create_space_template_body_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/create_space_template_body_model.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/tag_body_model.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
class Tag {
|
class Tag {
|
||||||
@ -58,4 +59,10 @@ extension TagModelExtensions on Tag {
|
|||||||
..tag = tag ?? ''
|
..tag = tag ?? ''
|
||||||
..productUuid = product?.uuid;
|
..productUuid = product?.uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CreateTagBodyModel toCreateTagBodyModel() {
|
||||||
|
return CreateTagBodyModel()
|
||||||
|
..tag = tag ?? ''
|
||||||
|
..productUuid = product?.uuid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,6 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
|
|||||||
shouldNavigateToSpaceModelPage: false,
|
shouldNavigateToSpaceModelPage: false,
|
||||||
);
|
);
|
||||||
} else if (state is SpaceManagementLoaded) {
|
} else if (state is SpaceManagementLoaded) {
|
||||||
print("sdksndsnadf ${state.spaceModels}");
|
|
||||||
return LoadedSpaceView(
|
return LoadedSpaceView(
|
||||||
communities: state.communities,
|
communities: state.communities,
|
||||||
selectedCommunity: state.selectedCommunity,
|
selectedCommunity: state.selectedCommunity,
|
||||||
|
@ -11,6 +11,8 @@ import 'package:syncrow_web/pages/spaces_management/all_spaces/model/selected_pr
|
|||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_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/community_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/connection_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/connection_model.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/subspace_model.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/tag.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/widgets/blank_community_widget.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/widgets/blank_community_widget.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/widgets/community_structure_header_widget.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/widgets/community_structure_header_widget.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/widgets/dialogs/create_space_dialog.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/widgets/dialogs/create_space_dialog.dart';
|
||||||
@ -55,7 +57,6 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
print("sxdsf ${widget.spaceModels}");
|
|
||||||
spaces = widget.spaces.isNotEmpty ? flattenSpaces(widget.spaces) : [];
|
spaces = widget.spaces.isNotEmpty ? flattenSpaces(widget.spaces) : [];
|
||||||
connections =
|
connections =
|
||||||
widget.spaces.isNotEmpty ? createConnections(widget.spaces) : [];
|
widget.spaces.isNotEmpty ? createConnections(widget.spaces) : [];
|
||||||
@ -293,7 +294,9 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
onCreateSpace: (String name,
|
onCreateSpace: (String name,
|
||||||
String icon,
|
String icon,
|
||||||
List<SelectedProduct> selectedProducts,
|
List<SelectedProduct> selectedProducts,
|
||||||
SpaceTemplateModel? spaceModel) {
|
SpaceTemplateModel? spaceModel,
|
||||||
|
List<SubspaceModel>? subspaces,
|
||||||
|
List<Tag>? tags) {
|
||||||
setState(() {
|
setState(() {
|
||||||
// Set the first space in the center or use passed position
|
// Set the first space in the center or use passed position
|
||||||
|
|
||||||
@ -307,7 +310,8 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
children: [],
|
children: [],
|
||||||
status: SpaceStatus.newSpace,
|
status: SpaceStatus.newSpace,
|
||||||
spaceModel: spaceModel,
|
spaceModel: spaceModel,
|
||||||
);
|
subspaces: subspaces,
|
||||||
|
tags: tags);
|
||||||
|
|
||||||
if (parentIndex != null && direction != null) {
|
if (parentIndex != null && direction != null) {
|
||||||
SpaceModel parentSpace = spaces[parentIndex];
|
SpaceModel parentSpace = spaces[parentIndex];
|
||||||
@ -346,12 +350,16 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
|||||||
onCreateSpace: (String name,
|
onCreateSpace: (String name,
|
||||||
String icon,
|
String icon,
|
||||||
List<SelectedProduct> selectedProducts,
|
List<SelectedProduct> selectedProducts,
|
||||||
SpaceTemplateModel? spaceModel) {
|
SpaceTemplateModel? spaceModel,
|
||||||
|
List<SubspaceModel>? subspaces,
|
||||||
|
List<Tag>? tags) {
|
||||||
setState(() {
|
setState(() {
|
||||||
// Update the space's properties
|
// Update the space's properties
|
||||||
space.name = name;
|
space.name = name;
|
||||||
space.icon = icon;
|
space.icon = icon;
|
||||||
space.spaceModel = spaceModel;
|
space.spaceModel = spaceModel;
|
||||||
|
space.subspaces= subspaces;
|
||||||
|
space.tags = tags;
|
||||||
|
|
||||||
if (space.status != SpaceStatus.newSpace) {
|
if (space.status != SpaceStatus.newSpace) {
|
||||||
space.status = SpaceStatus.modified; // Mark as modified
|
space.status = SpaceStatus.modified; // Mark as modified
|
||||||
|
@ -18,7 +18,7 @@ import 'package:syncrow_web/utils/constants/space_icon_const.dart';
|
|||||||
|
|
||||||
class CreateSpaceDialog extends StatefulWidget {
|
class CreateSpaceDialog extends StatefulWidget {
|
||||||
final Function(String, String, List<SelectedProduct> selectedProducts,
|
final Function(String, String, List<SelectedProduct> selectedProducts,
|
||||||
SpaceTemplateModel? spaceModel) onCreateSpace;
|
SpaceTemplateModel? spaceModel, List<SubspaceModel>? subspaces, List<Tag>? tags) onCreateSpace;
|
||||||
final List<ProductModel>? products;
|
final List<ProductModel>? products;
|
||||||
final String? name;
|
final String? name;
|
||||||
final String? icon;
|
final String? icon;
|
||||||
@ -487,7 +487,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
_showTagCreateDialog(context, enteredName,
|
_showTagCreateDialog(context, enteredName,
|
||||||
tags, subspaces, widget.products);
|
widget.products);
|
||||||
// Edit action
|
// Edit action
|
||||||
},
|
},
|
||||||
child: Chip(
|
child: Chip(
|
||||||
@ -511,8 +511,8 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
|
|||||||
)
|
)
|
||||||
: DefaultButton(
|
: DefaultButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_showTagCreateDialog(context, enteredName, tags,
|
_showTagCreateDialog(
|
||||||
subspaces, widget.products);
|
context, enteredName, widget.products);
|
||||||
},
|
},
|
||||||
backgroundColor: ColorsManager.textFieldGreyColor,
|
backgroundColor: ColorsManager.textFieldGreyColor,
|
||||||
foregroundColor: Colors.black,
|
foregroundColor: Colors.black,
|
||||||
@ -580,7 +580,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
|
|||||||
: (widget.name ?? '');
|
: (widget.name ?? '');
|
||||||
if (newName.isNotEmpty) {
|
if (newName.isNotEmpty) {
|
||||||
widget.onCreateSpace(newName, selectedIcon,
|
widget.onCreateSpace(newName, selectedIcon,
|
||||||
selectedProducts, selectedSpaceModel);
|
selectedProducts, selectedSpaceModel,subspaces,tags);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -673,11 +673,7 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _showTagCreateDialog(
|
void _showTagCreateDialog(
|
||||||
BuildContext context,
|
BuildContext context, String name, List<ProductModel>? products) {
|
||||||
String name,
|
|
||||||
final List<Tag>? spaceTags,
|
|
||||||
List<SubspaceModel>? subspaces,
|
|
||||||
List<ProductModel>? products) {
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@ -685,16 +681,18 @@ class CreateSpaceDialogState extends State<CreateSpaceDialog> {
|
|||||||
spaceName: name,
|
spaceName: name,
|
||||||
products: products,
|
products: products,
|
||||||
subspaces: subspaces,
|
subspaces: subspaces,
|
||||||
spaceTags: spaceTags,
|
spaceTags: tags,
|
||||||
allTags: [],
|
allTags: [],
|
||||||
initialSelectedProducts:
|
initialSelectedProducts:
|
||||||
createInitialSelectedProducts(tags, subspaces),
|
createInitialSelectedProducts(tags, subspaces),
|
||||||
onSave: (selectedSpaceTags, selectedSubspaces) {
|
onSave: (selectedSpaceTags, selectedSubspaces) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (spaceTags != null) selectedSpaceTags = spaceTags;
|
tags = selectedSpaceTags;
|
||||||
|
selectedSpaceModel = null;
|
||||||
|
|
||||||
if (selectedSubspaces != null) {
|
if (selectedSubspaces != null) {
|
||||||
if (subspaces != null) {
|
if (subspaces != null) {
|
||||||
for (final subspace in subspaces) {
|
for (final subspace in subspaces!) {
|
||||||
for (final selectedSubspace in selectedSubspaces) {
|
for (final selectedSubspace in selectedSubspaces) {
|
||||||
if (subspace.subspaceName ==
|
if (subspace.subspaceName ==
|
||||||
selectedSubspace.subspaceName) {
|
selectedSubspace.subspaceName) {
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
class CreateTagBodyModel {
|
||||||
|
late String tag;
|
||||||
|
late final String? productUuid;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return {
|
||||||
|
'tag': tag,
|
||||||
|
'productUuid': productUuid,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return toJson().toString();
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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/space_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_response_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/space_response_model.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/create_space_template_body_model.dart';
|
||||||
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/tag_body_model.dart';
|
||||||
import 'package:syncrow_web/services/api/http_service.dart';
|
import 'package:syncrow_web/services/api/http_service.dart';
|
||||||
import 'package:syncrow_web/utils/constants/api_const.dart';
|
import 'package:syncrow_web/utils/constants/api_const.dart';
|
||||||
import 'package:syncrow_web/utils/constants/temp_const.dart';
|
import 'package:syncrow_web/utils/constants/temp_const.dart';
|
||||||
@ -161,15 +164,17 @@ class CommunitySpaceManagementApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<SpaceModel?> createSpace({
|
Future<SpaceModel?> createSpace(
|
||||||
required String communityId,
|
{required String communityId,
|
||||||
required String name,
|
required String name,
|
||||||
String? parentId,
|
String? parentId,
|
||||||
String? direction,
|
String? direction,
|
||||||
bool isPrivate = false,
|
bool isPrivate = false,
|
||||||
required Offset position,
|
required Offset position,
|
||||||
|
String? spaceModelUuid,
|
||||||
String? icon,
|
String? icon,
|
||||||
}) async {
|
List<CreateTagBodyModel>? tags,
|
||||||
|
List<CreateSubspaceModel>? subspaces}) async {
|
||||||
try {
|
try {
|
||||||
final body = {
|
final body = {
|
||||||
'spaceName': name,
|
'spaceName': name,
|
||||||
@ -182,6 +187,13 @@ class CommunitySpaceManagementApi {
|
|||||||
if (parentId != null) {
|
if (parentId != null) {
|
||||||
body['parentUuid'] = parentId;
|
body['parentUuid'] = parentId;
|
||||||
}
|
}
|
||||||
|
if (tags != null) {
|
||||||
|
body['tags'] = tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (spaceModelUuid != null) body['spaceModelUuid'] = spaceModelUuid;
|
||||||
|
|
||||||
|
if (subspaces != null) body['subspaces'] = subspaces;
|
||||||
final response = await HTTPService().post(
|
final response = await HTTPService().post(
|
||||||
path: ApiEndpoints.createSpace
|
path: ApiEndpoints.createSpace
|
||||||
.replaceAll('{communityId}', communityId)
|
.replaceAll('{communityId}', communityId)
|
||||||
@ -263,7 +275,6 @@ class CommunitySpaceManagementApi {
|
|||||||
.replaceAll('{communityId}', communityId)
|
.replaceAll('{communityId}', communityId)
|
||||||
.replaceAll('{projectId}', TempConst.projectId),
|
.replaceAll('{projectId}', TempConst.projectId),
|
||||||
expectedResponseModel: (json) {
|
expectedResponseModel: (json) {
|
||||||
print(json);
|
|
||||||
final spaceModels = (json['data'] as List)
|
final spaceModels = (json['data'] as List)
|
||||||
.map((spaceJson) => SpaceModel.fromJson(spaceJson))
|
.map((spaceJson) => SpaceModel.fromJson(spaceJson))
|
||||||
.toList();
|
.toList();
|
||||||
|
Reference in New Issue
Block a user