mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-26 20:44:54 +00:00
fixed tag model
This commit is contained in:
@ -1,19 +1,25 @@
|
||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class TagModel {
|
||||
String? uuid;
|
||||
String tag;
|
||||
final ProductModel? product;
|
||||
String internalId;
|
||||
|
||||
TagModel({
|
||||
this.uuid,
|
||||
required this.tag,
|
||||
this.product,
|
||||
});
|
||||
String? internalId,
|
||||
}) : internalId = internalId ?? const Uuid().v4();
|
||||
|
||||
factory TagModel.fromJson(Map<String, dynamic> json) {
|
||||
final String internalId = json['internalId'] ?? const Uuid().v4();
|
||||
|
||||
return TagModel(
|
||||
uuid: json['uuid'] ?? '',
|
||||
internalId: internalId,
|
||||
tag: json['tag'] ?? '',
|
||||
product: json['product'] != null
|
||||
? ProductModel.fromMap(json['product'])
|
||||
@ -29,4 +35,3 @@ class TagModel {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user