mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-26 18:34:56 +00:00
added load new space models
This commit is contained in:
@ -6,7 +6,7 @@ import 'package:syncrow_web/utils/constants/action_enum.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class SpaceTemplateModel extends Equatable {
|
||||
final String? uuid;
|
||||
String? uuid;
|
||||
String modelName;
|
||||
List<SubspaceTemplateModel>? subspaceModels;
|
||||
final List<TagModel>? tags;
|
||||
@ -31,16 +31,18 @@ class SpaceTemplateModel extends Equatable {
|
||||
internalId: internalId,
|
||||
modelName: json['modelName'] ?? '',
|
||||
subspaceModels: (json['subspaceModels'] as List<dynamic>?)
|
||||
?.map((e) => SubspaceTemplateModel.fromJson(e))
|
||||
?.where((e) => e is Map<String, dynamic>) // Validate type
|
||||
.map((e) =>
|
||||
SubspaceTemplateModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
[],
|
||||
tags: (json['tags'] as List<dynamic>?)
|
||||
?.map((item) => TagModel.fromJson(item))
|
||||
?.where((item) => item is Map<String, dynamic>) // Validate type
|
||||
.map((item) => TagModel.fromJson(item as Map<String, dynamic>))
|
||||
.toList() ??
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
SpaceTemplateModel copyWith({
|
||||
String? uuid,
|
||||
String? modelName,
|
||||
|
||||
Reference in New Issue
Block a user