mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
Add factory method empty
to SpaceDetailsModel
for creating default instances
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:syncrow_web/pages/space_management_v2/modules/products/domain/models/product.dart';
|
||||
import 'package:syncrow_web/pages/space_management_v2/modules/tags/domain/models/tag.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class SpaceDetailsModel extends Equatable {
|
||||
final String uuid;
|
||||
@ -17,6 +18,13 @@ class SpaceDetailsModel extends Equatable {
|
||||
required this.subspaces,
|
||||
});
|
||||
|
||||
factory SpaceDetailsModel.empty() => const SpaceDetailsModel(
|
||||
uuid: '',
|
||||
spaceName: '',
|
||||
icon: Assets.villa,
|
||||
productAllocations: [],
|
||||
subspaces: [],
|
||||
);
|
||||
factory SpaceDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||
return SpaceDetailsModel(
|
||||
uuid: json['uuid'] as String,
|
||||
|
Reference in New Issue
Block a user